Module Name: src Committed By: martin Date: Thu Sep 21 13:22:46 UTC 2023
Modified Files: src/sys/netinet [netbsd-10]: tcp_output.c Log Message: Pull up following revision(s) (requested by bouyer in ticket #377): sys/netinet/tcp_output.c: revision 1.219 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.218.2.1 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.218.2.1 --- src/sys/netinet/tcp_output.c:1.218 Fri Nov 4 09:01:53 2022 +++ src/sys/netinet/tcp_output.c Thu Sep 21 13:22:46 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.218.2.1 2023/09/21 13:22:46 martin 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.218.2.1 2023/09/21 13:22:46 martin 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; }