From 2d166c0202c964794aae2f295aa347df829ba266 Mon Sep 17 00:00:00 2001 From: Andre Oppermann Date: Fri, 23 Apr 2004 22:44:59 +0000 Subject: [PATCH] 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 --- sys/netinet/tcp_input.c | 4 ++-- 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 d73e8fe39f9e..90cda71389bb 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 d73e8fe39f9e..90cda71389bb 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) {