aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Stewart <rrs@FreeBSD.org>2021-05-24 18:42:15 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2021-06-09 00:12:21 +0000
commite99fa57b981eaeac287a1d0d8c0b351740f7a30b (patch)
treea83af503de01de5409adb728d4849a1713e00e17
parent6264ff9bd9f0f01f052b9b100af12e53613a825c (diff)
downloadsrc-e99fa57b981eaeac287a1d0d8c0b351740f7a30b.tar.gz
src-e99fa57b981eaeac287a1d0d8c0b351740f7a30b.zip
tcp: Fix an issue with the PUSH bit as well as fill in the missing mtu change for fsb's
The push bit itself was also not actually being properly moved to the right edge. The FIN bit was incorrectly on the left edge. We fix these two issues as well as plumb in the mtu_change for alternate stacks. Reviewed by: mtuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30413 (cherry picked from commit 631449d5d03506295eaa6947c1b0e8a168a2f6b7)
-rw-r--r--sys/netinet/tcp_stacks/rack.c8
-rw-r--r--sys/netinet/tcp_subr.c9
2 files changed, 15 insertions, 2 deletions
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
index c870b286a847..0bdcc20d2b7c 100644
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -6058,8 +6058,12 @@ rack_clone_rsm(struct tcp_rack *rack, struct rack_sendmap *nrsm,
if (nrsm->r_flags & RACK_HAS_SYN)
nrsm->r_flags &= ~RACK_HAS_SYN;
/* Now if we have a FIN flag we keep it on the right edge */
- if (nrsm->r_flags & RACK_HAS_FIN)
- nrsm->r_flags &= ~RACK_HAS_FIN;
+ if (rsm->r_flags & RACK_HAS_FIN)
+ rsm->r_flags &= ~RACK_HAS_FIN;
+ /* Push bit must go to the right edge as well */
+ if (rsm->r_flags & RACK_HAD_PUSH)
+ rsm->r_flags &= ~RACK_HAD_PUSH;
+
/*
* Now we need to find nrsm's new location in the mbuf chain
* we basically calculate a new offset, which is soff +
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index b9da908d2a15..bb2c35c76fde 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -3373,6 +3373,15 @@ tcp_mtudisc(struct inpcb *inp, int mtuoffer)
tp->snd_recover = tp->snd_max;
if (tp->t_flags & TF_SACK_PERMIT)
EXIT_FASTRECOVERY(tp->t_flags);
+ if (tp->t_fb->tfb_tcp_mtu_chg != NULL) {
+ /*
+ * Conceptually the snd_nxt setting
+ * and freeing sack holes should
+ * be done by the default stacks
+ * own tfb_tcp_mtu_chg().
+ */
+ tp->t_fb->tfb_tcp_mtu_chg(tp);
+ }
tp->t_fb->tfb_tcp_output(tp);
}