Hi,

When relaying unidirectional tcp traffic, relayd handles session
timeouts in a strange way.

A connection that is constantly sending data from the client to the
server will always trigger the session timeout.  In contrast, if
the data is only transfered from the server to the client, the
session timeout works correctly.

The reason for this asymmetric behavoir is that any read event
resets the client side timeout.  I think a read event on one side
should reset the timeout for the other side.

ok?

bluhm


Index: relay.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/relayd/relay.c,v
retrieving revision 1.128
diff -u -p -r1.128 relay.c
--- relay.c     20 Dec 2010 12:38:06 -0000      1.128
+++ relay.c     11 Mar 2011 13:16:50 -0000
@@ -906,7 +906,7 @@ relay_read(struct bufferevent *bev, void
                goto fail;
        if (con->se_done)
                goto done;
-       bufferevent_enable(con->se_in.bev, EV_READ);
+       bufferevent_enable(cre->dst->bev, EV_READ);
        return;
  done:
        relay_close(con, "last read (done)");

Reply via email to