summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6.c
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2013-07-31 16:24:49 +0000
committerhrs <hrs@FreeBSD.org>2013-07-31 16:24:49 +0000
commit64e5ea06531a17c184bfb8319a36165135f613c5 (patch)
tree53fdee48ca3460bd33377932da455eae2ecfd826 /sys/netinet6/in6.c
parent8ceb091210c8542007672f9ee2739bafbc4eb453 (diff)
downloadFreeBSD-src-64e5ea06531a17c184bfb8319a36165135f613c5.zip
FreeBSD-src-64e5ea06531a17c184bfb8319a36165135f613c5.tar.gz
Allocate in6_ifextra (ifp->if_afdata[AF_INET6]) only for IPv6-capable
interfaces. This eliminates unnecessary IPv6 processing for non-IPv6 interfaces. MFC after: 3 days
Diffstat (limited to 'sys/netinet6/in6.c')
-rw-r--r--sys/netinet6/in6.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c
index f8c2b7e..a8930d7 100644
--- a/sys/netinet6/in6.c
+++ b/sys/netinet6/in6.c
@@ -2746,6 +2746,13 @@ in6_domifattach(struct ifnet *ifp)
{
struct in6_ifextra *ext;
+ /* There are not IPv6-capable interfaces. */
+ switch (ifp->if_type) {
+ case IFT_PFLOG:
+ case IFT_PFSYNC:
+ case IFT_USB:
+ return (NULL);
+ }
ext = (struct in6_ifextra *)malloc(sizeof(*ext), M_IFADDR, M_WAITOK);
bzero(ext, sizeof(*ext));
OpenPOWER on IntegriCloud