svn commit: r302784 - head/sys/netinet6
Dimitry Andric
dim at FreeBSD.org
Wed Jul 13 19:41:20 UTC 2016
Author: dim
Date: Wed Jul 13 19:41:19 2016
New Revision: 302784
URL: https://svnweb.freebsd.org/changeset/base/302784
Log:
Fix a page fault in ip6_setpktopt(), occurring when the pflog module is
loaded, and syncthing is started, which uses setsockopt(IPV6_PKGINFO).
This is because pflog interfaces do not normally have an IPv6 address,
causing the ND_IFINFO() macro to dereference a NULL pointer.
Reviewed by: ae
PR: 210943
MFC after: 3 days
Modified:
head/sys/netinet6/ip6_output.c
Modified: head/sys/netinet6/ip6_output.c
==============================================================================
--- head/sys/netinet6/ip6_output.c Wed Jul 13 19:19:18 2016 (r302783)
+++ head/sys/netinet6/ip6_output.c Wed Jul 13 19:41:19 2016 (r302784)
@@ -2659,8 +2659,8 @@ ip6_setpktopt(int optname, u_char *buf,
if (ifp == NULL)
return (ENXIO);
}
- if (ifp != NULL && (
- ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED))
+ if (ifp != NULL && (ifp->if_afdata[AF_INET6] == NULL ||
+ (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED) != 0))
return (ENETDOWN);
if (ifp != NULL &&
More information about the svn-src-all
mailing list