summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2018-04-14 20:42:42 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2018-04-14 20:42:42 +0000
commita29abbb3e4d897b3475ade70d98d44528b161ef4 (patch)
tree34b9f968612a6dfba60644bd6fbaa3da50c49fd7 /usr.sbin
parentb2b70bbb8774be1d73abacce4a9b71bd9504a69c (diff)
In case of a tcp read timeout, the destination host state needs to be
set to HOST_DOWN. Noticed and fixed by Rivo Nurges <Rivo DOT Nurges AT smit DOT ee> ok and reminder florian@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/relayd/check_tcp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/relayd/check_tcp.c b/usr.sbin/relayd/check_tcp.c
index 120bf5f92d1..3a3ac92c29e 100644
--- a/usr.sbin/relayd/check_tcp.c
+++ b/usr.sbin/relayd/check_tcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: check_tcp.c,v 1.55 2017/07/04 20:27:09 benno Exp $ */
+/* $OpenBSD: check_tcp.c,v 1.56 2018/04/14 20:42:41 benno Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -243,8 +243,10 @@ tcp_read_buf(int s, short event, void *arg)
if (event == EV_TIMEOUT) {
if (ibuf_size(cte->buf))
(void)cte->validate_close(cte);
- else
+ else {
cte->host->he = HCE_TCP_READ_TIMEOUT;
+ cte->host->up = HOST_DOWN;
+ }
tcp_close(cte, cte->host->up == HOST_UP ? 0 : HOST_DOWN);
hce_notify_done(cte->host, cte->host->he);
return;