svn commit: r190198 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet

Bjoern A. Zeeb bz at FreeBSD.org
Sat Mar 21 05:02:21 PDT 2009


Author: bz
Date: Sat Mar 21 12:02:11 2009
New Revision: 190198
URL: http://svn.freebsd.org/changeset/base/190198

Log:
  MFC r185371:
    Replace most INP_CHECK_SOCKAF() uses checking if it is an
    IPv6 socket by comparing a constant inp vflag.
    This is expected to help to reduce extra locking.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/netinet/tcp_output.c
  stable/7/sys/netinet/tcp_usrreq.c

Modified: stable/7/sys/netinet/tcp_output.c
==============================================================================
--- stable/7/sys/netinet/tcp_output.c	Sat Mar 21 11:18:59 2009	(r190197)
+++ stable/7/sys/netinet/tcp_output.c	Sat Mar 21 12:02:11 2009	(r190198)
@@ -1113,7 +1113,7 @@ timer:
     {
 	ip->ip_len = m->m_pkthdr.len;
 #ifdef INET6
-	if (INP_CHECK_SOCKAF(so, AF_INET6))
+	if (tp->t_inpcb->inp_vflag & INP_IPV6PROTO)
 		ip->ip_ttl = in6_selecthlim(tp->t_inpcb, NULL);
 #endif /* INET6 */
 	/*

Modified: stable/7/sys/netinet/tcp_usrreq.c
==============================================================================
--- stable/7/sys/netinet/tcp_usrreq.c	Sat Mar 21 11:18:59 2009	(r190197)
+++ stable/7/sys/netinet/tcp_usrreq.c	Sat Mar 21 12:02:11 2009	(r190198)
@@ -1242,7 +1242,7 @@ tcp_ctloutput(struct socket *so, struct 
 	INP_WLOCK(inp);
 	if (sopt->sopt_level != IPPROTO_TCP) {
 #ifdef INET6
-		if (INP_CHECK_SOCKAF(so, AF_INET6)) {
+		if (inp->inp_vflag & INP_IPV6PROTO) {
 			INP_WUNLOCK(inp);
 			error = ip6_ctloutput(so, sopt);
 		} else {
@@ -1421,9 +1421,6 @@ tcp_attach(struct socket *so)
 	struct tcpcb *tp;
 	struct inpcb *inp;
 	int error;
-#ifdef INET6
-	int isipv6 = INP_CHECK_SOCKAF(so, AF_INET6) != 0;
-#endif
 
 	if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) {
 		error = soreserve(so, tcp_sendspace, tcp_recvspace);
@@ -1440,7 +1437,7 @@ tcp_attach(struct socket *so)
 	}
 	inp = sotoinpcb(so);
 #ifdef INET6
-	if (isipv6) {
+	if (inp->inp_vflag & INP_IPV6PROTO) {
 		inp->inp_vflag |= INP_IPV6;
 		inp->in6p_hops = -1;	/* use kernel default */
 	}


More information about the svn-src-all mailing list