svn commit: r340958 - stable/10/sys/net

Eugene Grosbein eugen at FreeBSD.org
Mon Nov 26 12:19:32 UTC 2018


Author: eugen
Date: Mon Nov 26 12:19:30 2018
New Revision: 340958
URL: https://svnweb.freebsd.org/changeset/base/340958

Log:
  Prevent stf(4) from panicing due to unprotected access
  to INADDR_HASH. This is direct commit to stable/10
  instead of MFC r339806 due to significant differences
  in code base.
  
  PR:			220078
  Differential Revision:	https://reviews.freebsd.org/D12457
  Tested-by:		Cassiano Peixoto and others

Modified:
  stable/10/sys/net/if_stf.c

Modified: stable/10/sys/net/if_stf.c
==============================================================================
--- stable/10/sys/net/if_stf.c	Mon Nov 26 11:51:44 2018	(r340957)
+++ stable/10/sys/net/if_stf.c	Mon Nov 26 12:19:30 2018	(r340958)
@@ -384,7 +384,6 @@ stf_getsrcifa6(ifp)
 	struct ifnet *ifp;
 {
 	struct ifaddr *ia;
-	struct in_ifaddr *ia4;
 	struct sockaddr_in6 *sin6;
 	struct in_addr in;
 
@@ -397,10 +396,7 @@ stf_getsrcifa6(ifp)
 			continue;
 
 		bcopy(GET_V4(&sin6->sin6_addr), &in, sizeof(in));
-		LIST_FOREACH(ia4, INADDR_HASH(in.s_addr), ia_hash)
-			if (ia4->ia_addr.sin_addr.s_addr == in.s_addr)
-				break;
-		if (ia4 == NULL)
+		if (!in_localip(in))
 			continue;
 
 		ifa_ref(ia);


More information about the svn-src-all mailing list