From 0f015b3f5d92feb3e54e9265513fd5313115ba1e Mon Sep 17 00:00:00 2001 From: wenchengji <58921247+wenchengji159357@users.noreply.github.com> Date: Mon, 9 Jan 2023 06:51:16 +0000 Subject: [PATCH] when nginx use setsockopt ON_LINGER, the seq number of the RST packet is error. Use tcpdump to capture packets and you will find the problem. See:https://reviews.freebsd.org/D30036. --- freebsd/netinet/tcp_stacks/bbr.c | 9 --------- freebsd/netinet/tcp_stacks/rack.c | 9 --------- 2 files changed, 18 deletions(-) diff --git a/freebsd/netinet/tcp_stacks/bbr.c b/freebsd/netinet/tcp_stacks/bbr.c index 697fce5b0..4381ef791 100644 --- a/freebsd/netinet/tcp_stacks/bbr.c +++ b/freebsd/netinet/tcp_stacks/bbr.c @@ -13489,15 +13489,6 @@ send: th->th_seq = htonl(tp->snd_max); bbr_seq = tp->snd_max; } - } else if (flags & TH_RST) { - /* - * For a Reset send the last cum ack in sequence - * (this like any other choice may still generate a - * challenge ack, if a ack-update packet is in - * flight). - */ - th->th_seq = htonl(tp->snd_una); - bbr_seq = tp->snd_una; } else { /* * len == 0 and not persist we use snd_max, sending diff --git a/freebsd/netinet/tcp_stacks/rack.c b/freebsd/netinet/tcp_stacks/rack.c index 5b7234fdb..6f1c5046c 100644 --- a/freebsd/netinet/tcp_stacks/rack.c +++ b/freebsd/netinet/tcp_stacks/rack.c @@ -13487,15 +13487,6 @@ send: rack->rc_in_persist) { th->th_seq = htonl(tp->snd_nxt); rack_seq = tp->snd_nxt; - } else if (flags & TH_RST) { - /* - * For a Reset send the last cum ack in sequence - * (this like any other choice may still generate a - * challenge ack, if a ack-update packet is in - * flight). - */ - th->th_seq = htonl(tp->snd_una); - rack_seq = tp->snd_una; } else { th->th_seq = htonl(tp->snd_max); rack_seq = tp->snd_max;