No events were added for DNS UDP so it stopped working after the first
authorreyk <reyk@openbsd.org>
Fri, 8 Aug 2014 18:26:50 +0000 (18:26 +0000)
committerreyk <reyk@openbsd.org>
Fri, 8 Aug 2014 18:26:50 +0000 (18:26 +0000)
request.  Additionally, the DNS code tried to use an invalid timeout.

Fix from mm@freebsd.org
Reported by Johan Schuijt

usr.sbin/relayd/relay_udp.c

index 5ed418c..d20e1b2 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: relay_udp.c,v 1.31 2014/07/13 00:32:08 benno Exp $    */
+/*     $OpenBSD: relay_udp.c,v 1.32 2014/08/08 18:26:50 reyk Exp $     */
 
 /*
  * Copyright (c) 2007 - 2013 Reyk Floeter <reyk@openbsd.org>
@@ -219,6 +219,8 @@ relay_udp_server(int fd, short sig, void *arg)
        void *priv = NULL;
        ssize_t len;
 
+       event_add(&rlay->rl_ev, NULL);
+
        if (relay_sessions >= RELAY_MAX_SESSIONS ||
            rlay->rl_conf.flags & F_DISABLE)
                return;
@@ -498,7 +500,7 @@ relay_dns_request(struct rsession *con)
        }
 
        event_again(&con->se_ev, con->se_out.s, EV_TIMEOUT|EV_READ,
-           relay_udp_response, &con->se_tv_start, &env->sc_timeout, con);
+           relay_udp_response, &con->se_tv_start, &rlay->rl_conf.timeout, con);
 
        return (0);
 }