diff options
author | bz <bz@FreeBSD.org> | 2012-05-25 01:13:39 +0000 |
---|---|---|
committer | bz <bz@FreeBSD.org> | 2012-05-25 01:13:39 +0000 |
commit | efb14c628e4e807d6d94a4a6d7b24383c536ece5 (patch) | |
tree | 8fd38922b8fffcf1d60216be18dcf1c857e2d20b /sys/netinet/tcp_input.c | |
parent | 1eaf836b4d7a3e8a2f005b3640c67f3f7bcca3fc (diff) | |
download | FreeBSD-src-efb14c628e4e807d6d94a4a6d7b24383c536ece5.zip FreeBSD-src-efb14c628e4e807d6d94a4a6d7b24383c536ece5.tar.gz |
MFp4 bz_ipv6_fast:
Factor out the tcp_hc_getmtu() call. As the comments say it
applies to both v4 and v6, so only write it once making it easier
to read the protocol family specifc code.
Sponsored by: The FreeBSD Foundation
Sponsored by: iXsystems
Reviewed by: gnn (as part of the whole)
MFC After: 3 days
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 7c8310f..701fafb 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -3542,7 +3542,6 @@ tcp_mssopt(struct in_conninfo *inc) if (inc->inc_flags & INC_ISIPV6) { mss = V_tcp_v6mssdflt; maxmtu = tcp_maxmtu6(inc, NULL); - thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ min_protoh = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); } #endif @@ -3553,10 +3552,13 @@ tcp_mssopt(struct in_conninfo *inc) { mss = V_tcp_mssdflt; maxmtu = tcp_maxmtu(inc, NULL); - thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ min_protoh = sizeof(struct tcpiphdr); } #endif +#if defined(INET6) || defined(INET) + thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */ +#endif + if (maxmtu && thcmtu) mss = min(maxmtu, thcmtu) - min_protoh; else if (maxmtu || thcmtu) |