From b3ad23448a26821207030a854741b6b8534ae33c Mon Sep 17 00:00:00 2001 From: reyk Date: Fri, 8 Aug 2014 18:26:50 +0000 Subject: [PATCH] No events were added for DNS UDP so it stopped working after the first 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/relayd/relay_udp.c b/usr.sbin/relayd/relay_udp.c index 5ed418c5711..d20e1b2146a 100644 --- a/usr.sbin/relayd/relay_udp.c +++ b/usr.sbin/relayd/relay_udp.c @@ -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 @@ -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); } -- 2.20.1