git: 3e8226cb8c83 - stable/13 - tcp rack, bbr: improve handling of soft errors

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Thu, 31 Oct 2024 16:36:33 UTC
The branch stable/13 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=3e8226cb8c8333c4e0a1118fe09d0a7b6e5711cd

commit 3e8226cb8c8333c4e0a1118fe09d0a7b6e5711cd
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2024-08-30 07:26:41 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2024-10-31 16:36:28 +0000

    tcp rack, bbr: improve handling of soft errors
    
    Do not report an error, if it is stored as a soft error. This avoids,
    for example, the dropping of TCP connections using an interface,
    while enabling or disabling LRO on that interface.
    
    Reviewed by:            cc
    Sponsored by:           Netflix, Inc.
    Differential Revision:  https://reviews.freebsd.org/D46427
    
    (cherry picked from commit b2044c4557443bbce974101f04e2b465d1bbe769)
---
 sys/netinet/tcp_stacks/bbr.c  | 1 +
 sys/netinet/tcp_stacks/rack.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c
index 8fde062c0dc7..5ebf82eb97d9 100644
--- a/sys/netinet/tcp_stacks/bbr.c
+++ b/sys/netinet/tcp_stacks/bbr.c
@@ -13961,6 +13961,7 @@ nomore:
 		case ENETUNREACH:
 			if (TCPS_HAVERCVDSYN(tp->t_state)) {
 				tp->t_softerror = error;
+				error = 0;
 			}
 			/* FALLTHROUGH */
 		default:
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index 7429dcac5d5b..ce1f2b88cef8 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -18571,6 +18571,7 @@ nomore:
 		case ENETDOWN:
 			if (TCPS_HAVERCVDSYN(tp->t_state)) {
 				tp->t_softerror = error;
+				error = 0;
 			}
 			/* FALLTHROUGH */
 		default: