Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Jul 2012 12:36:45 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r238243 - stable/9/sys/netinet
Message-ID:  <201207081236.q68Cajb7051879@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Sun Jul  8 12:36:44 2012
New Revision: 238243
URL: http://svn.freebsd.org/changeset/base/238243

Log:
  MFC r235950:
  
     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.
  
  Approved by:	re

Modified:
  stable/9/sys/netinet/tcp_input.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet/tcp_input.c
==============================================================================
--- stable/9/sys/netinet/tcp_input.c	Sun Jul  8 12:34:12 2012	(r238242)
+++ stable/9/sys/netinet/tcp_input.c	Sun Jul  8 12:36:44 2012	(r238243)
@@ -3594,7 +3594,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
@@ -3605,10 +3604,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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207081236.q68Cajb7051879>