diff options
author | pkelsey <pkelsey@FreeBSD.org> | 2015-07-15 16:57:40 +0000 |
---|---|---|
committer | pkelsey <pkelsey@FreeBSD.org> | 2015-07-15 16:57:40 +0000 |
commit | bc26e9b8dcbc8ea84df498c94aaab53fdd29802a (patch) | |
tree | 4c5a5a68da86fde9658ea59d6ca06a1068c75c23 /sys/net/if_loop.c | |
parent | df980625bb6132b2f97b68246dd8d1720425da1f (diff) | |
download | FreeBSD-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/if_loop.c')
-rw-r--r-- | sys/net/if_loop.c | 2 |
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; |