Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jul 2015 02:12:49 +0000 (UTC)
From:      Patrick Kelsey <pkelsey@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r285190 - head/sys/net
Message-ID:  <201507060212.t662Com6018317@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pkelsey
Date: Mon Jul  6 02:12:49 2015
New Revision: 285190
URL: https://svnweb.freebsd.org/changeset/base/285190

Log:
  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.
  
  Differential Revision: https://reviews.freebsd.org/D2989
  Reviewed by: gnn, melifaro
  Approved by: jmallett (mentor)
  MFC after: 3 days

Modified:
  head/sys/net/if_loop.c

Modified: head/sys/net/if_loop.c
==============================================================================
--- head/sys/net/if_loop.c	Mon Jul  6 01:48:23 2015	(r285189)
+++ head/sys/net/if_loop.c	Mon Jul  6 02:12:49 2015	(r285190)
@@ -229,7 +229,7 @@ looutput(struct ifnet *ifp, struct mbuf 
 	if_inc_counter(ifp, IFCOUNTER_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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507060212.t662Com6018317>