Module Name:    src
Committed By:   bouyer
Date:           Wed Sep 13 15:54:28 UTC 2023

Modified Files:
        src/sys/netinet: tcp_output.c

Log Message:
Handle EHOSTDOWN the same way as EHOSTUNREACH and ENETDOWN for established
connections. Avoid premature end of tcp connection with "Host is down" error
in case of transient link-layer failure.
Discussed and patch proposed in
http://mail-index.netbsd.org/tech-net/2023/09/11/msg008610.html
and followups.


To generate a diff of this commit:
cvs rdiff -u -r1.218 -r1.219 src/sys/netinet/tcp_output.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/tcp_output.c
diff -u src/sys/netinet/tcp_output.c:1.218 src/sys/netinet/tcp_output.c:1.219
--- src/sys/netinet/tcp_output.c:1.218	Fri Nov  4 09:01:53 2022
+++ src/sys/netinet/tcp_output.c	Wed Sep 13 15:54:28 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_output.c,v 1.218 2022/11/04 09:01:53 ozaki-r Exp $	*/
+/*	$NetBSD: tcp_output.c,v 1.219 2023/09/13 15:54:28 bouyer Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -135,7 +135,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.218 2022/11/04 09:01:53 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_output.c,v 1.219 2023/09/13 15:54:28 bouyer Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1612,8 +1612,8 @@ out:
 			TCP_STATINC(TCP_STAT_SELFQUENCH);
 			tcp_quench(tp->t_inpcb);
 			error = 0;
-		} else if ((error == EHOSTUNREACH || error == ENETDOWN) &&
-		    TCPS_HAVERCVDSYN(tp->t_state)) {
+		} else if ((error == EHOSTUNREACH || error == ENETDOWN ||
+		    error == EHOSTDOWN) && TCPS_HAVERCVDSYN(tp->t_state)) {
 			tp->t_softerror = error;
 			error = 0;
 		}

Reply via email to