diff options
author | andre <andre@FreeBSD.org> | 2004-04-23 22:44:59 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2004-04-23 22:44:59 +0000 |
commit | 7357a88fdbc1ed5cd677cc232be3591207aaa45b (patch) | |
tree | 9ba14d9ff519cc297bed1d273354626436b20c1f | |
parent | a2939bc1de354a17c2e184e24be18cb195843a07 (diff) | |
download | FreeBSD-src-7357a88fdbc1ed5cd677cc232be3591207aaa45b.zip FreeBSD-src-7357a88fdbc1ed5cd677cc232be3591207aaa45b.tar.gz |
Correct an edge case in tcp_mss() where the cached path MTU
from tcp_hostcache would have overridden a (now) lower MTU of
an interface or route that changed since first PMTU discovery.
The bug would have caused TCP to redo the PMTU discovery when
not strictly necessary.
Make a comment about already pre-initialized default values
more clear.
Reviewed by: sam
-rw-r--r-- | sys/netinet/tcp_input.c | 4 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index d73e8fe..90cda71 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2793,7 +2793,7 @@ tcp_mss(tp, offer) so = inp->inp_socket; /* - * no route to sender, take default mss and return + * no route to sender, stay with default mss and return */ if (maxmtu == 0) return; @@ -2851,7 +2851,7 @@ tcp_mss(tp, offer) * else, use the link mtu. */ if (metrics.rmx_mtu) - mss = metrics.rmx_mtu - min_protoh; + mss = min(metrics.rmx_mtu, maxmtu) - min_protoh; else { #ifdef INET6 if (isipv6) { diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index d73e8fe..90cda71 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -2793,7 +2793,7 @@ tcp_mss(tp, offer) so = inp->inp_socket; /* - * no route to sender, take default mss and return + * no route to sender, stay with default mss and return */ if (maxmtu == 0) return; @@ -2851,7 +2851,7 @@ tcp_mss(tp, offer) * else, use the link mtu. */ if (metrics.rmx_mtu) - mss = metrics.rmx_mtu - min_protoh; + mss = min(metrics.rmx_mtu, maxmtu) - min_protoh; else { #ifdef INET6 if (isipv6) { |