summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorpkelsey <pkelsey@FreeBSD.org>2015-07-15 16:57:40 +0000
committerpkelsey <pkelsey@FreeBSD.org>2015-07-15 16:57:40 +0000
commitbc26e9b8dcbc8ea84df498c94aaab53fdd29802a (patch)
tree4c5a5a68da86fde9658ea59d6ca06a1068c75c23 /sys/net
parentdf980625bb6132b2f97b68246dd8d1720425da1f (diff)
downloadFreeBSD-src-bc26e9b8dcbc8ea84df498c94aaab53fdd29802a.zip
FreeBSD-src-bc26e9b8dcbc8ea84df498c94aaab53fdd29802a.tar.gz
MFC r285190:
Fix if_loop so bpfwrite() can use it regardless of the state of bd_hdrcmplt. As if_loop does not use link-level headers, its behavior when used by bpfwrite() should be the same regardless of the state of bd_hdrcmplt. Without this change, libpcap (and other BPF users that work like it) fail when writing to loopback interfaces. Approved by: re
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_loop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index e17fa11..ac3e306 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -241,7 +241,7 @@ looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
ifp->if_obytes += m->m_pkthdr.len;
/* BPF writes need to be handled specially. */
- if (dst->sa_family == AF_UNSPEC)
+ if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT)
bcopy(dst->sa_data, &af, sizeof(af));
else
af = dst->sa_family;
OpenPOWER on IntegriCloud