aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Kelsey <pkelsey@FreeBSD.org>2015-07-15 16:57:40 +0000
committerPatrick Kelsey <pkelsey@FreeBSD.org>2015-07-15 16:57:40 +0000
commit71ee29ab93aed361d2718ed46c557eeb0bfd88b8 (patch)
tree4c5a5a68da86fde9658ea59d6ca06a1068c75c23
parenta9e59b52636a02d3f7e6b0c2b226b1aa71c4ffa7 (diff)
downloadsrc-71ee29ab93aed361d2718ed46c557eeb0bfd88b8.tar.gz
src-71ee29ab93aed361d2718ed46c557eeb0bfd88b8.zip
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
Notes
Notes: svn path=/stable/10/; revision=285605
-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 e17fa11d122c..ac3e30650952 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;