svn commit: r285605 - stable/10/sys/net

Patrick Kelsey pkelsey at FreeBSD.org
Wed Jul 15 16:57:42 UTC 2015


Author: pkelsey
Date: Wed Jul 15 16:57:40 2015
New Revision: 285605
URL: https://svnweb.freebsd.org/changeset/base/285605

Log:
  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

Modified:
  stable/10/sys/net/if_loop.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/if_loop.c
==============================================================================
--- stable/10/sys/net/if_loop.c	Wed Jul 15 16:55:56 2015	(r285604)
+++ stable/10/sys/net/if_loop.c	Wed Jul 15 16:57:40 2015	(r285605)
@@ -241,7 +241,7 @@ looutput(struct ifnet *ifp, struct mbuf 
 	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;


More information about the svn-src-all mailing list