Date: Mon, 26 Nov 2018 12:19:31 +0000 (UTC) From: Eugene Grosbein <eugen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r340958 - stable/10/sys/net Message-ID: <201811261219.wAQCJVQt052701@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811261219.wAQCJVQt052701>