diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2021-06-30 11:26:50 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2021-06-30 11:26:50 +0000 |
commit | 8db643392aa11dd097be7f36d41659ea3892a3bf (patch) | |
tree | ca39ab7c93f31f86fd5b09fa2d50133938588fd5 /sys/netinet | |
parent | 9ebf6a4ef498ae30d06cc7e4d01f86d9a0633cc1 (diff) |
For path MTU discovery tcp_mtudisc() should resend a TCP packet by
calling tcp_output() if the TCP maximum segment size changes. But
that did not work, as the new value was compared before tcp_mss()
had a chance to modify it. Move the comparison and change it from
not equal to greater than. It makes only sense to resend a packet
immediately if it becomes smaller and is more likely to fit.
OK sashan@ tobhe@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_subr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 49f3aa89765..6ec0fb79c3c 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_subr.c,v 1.176 2021/02/25 02:48:21 dlg Exp $ */ +/* $OpenBSD: tcp_subr.c,v 1.177 2021/06/30 11:26:49 bluhm Exp $ */ /* $NetBSD: tcp_subr.c,v 1.22 1996/02/13 23:44:00 christos Exp $ */ /* @@ -837,15 +837,14 @@ tcp_mtudisc(struct inpcb *inp, int errno) { struct tcpcb *tp = intotcpcb(inp); struct rtentry *rt; - int change = 0; + int orig_maxseg, change = 0; if (tp == NULL) return; + orig_maxseg = tp->t_maxseg; rt = in_pcbrtentry(inp); if (rt != NULL) { - int orig_maxseg = tp->t_maxseg; - /* * If this was not a host route, remove and realloc. */ @@ -854,11 +853,12 @@ tcp_mtudisc(struct inpcb *inp, int errno) if ((rt = in_pcbrtentry(inp)) == NULL) return; } - if (orig_maxseg != tp->t_maxseg || - (rt->rt_locks & RTV_MTU)) + if (rt->rt_locks & RTV_MTU) change = 1; } tcp_mss(tp, -1); + if (orig_maxseg > tp->t_maxseg) + change = 1; /* * Resend unacknowledged packets |