Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Jan 2016 10:15:06 +0000 (UTC)
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r293035 - in head/sys: net netinet
Message-ID:  <201601011015.u01AF62N090123@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: melifaro
Date: Fri Jan  1 10:15:06 2016
New Revision: 293035
URL: https://svnweb.freebsd.org/changeset/base/293035

Log:
  Remove second EVENTHANDLER_REGISTER slipped in r292978.
  Describe the reason of doing unconditional M_PREPEND in ether_output().

Modified:
  head/sys/net/if_ethersubr.c
  head/sys/netinet/if_ether.c

Modified: head/sys/net/if_ethersubr.c
==============================================================================
--- head/sys/net/if_ethersubr.c	Fri Jan  1 04:04:40 2016	(r293034)
+++ head/sys/net/if_ethersubr.c	Fri Jan  1 10:15:06 2016	(r293035)
@@ -324,6 +324,10 @@ ether_output(struct ifnet *ifp, struct m
 	/*
 	 * Add local net header.  If no space in first mbuf,
 	 * allocate another.
+	 *
+	 * Note that we do prepend regardless of RT_HAS_HEADER flag.
+	 * This is done because BPF code shifts m_data pointer
+	 * to the end of ethernet header prior to calling if_output().
 	 */
 	M_PREPEND(m, hlen, M_NOWAIT);
 	if (m == NULL)

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Fri Jan  1 04:04:40 2016	(r293034)
+++ head/sys/netinet/if_ether.c	Fri Jan  1 10:15:06 2016	(r293035)
@@ -1334,8 +1334,5 @@ arp_init(void)
 	if (IS_DEFAULT_VNET(curvnet))
 		iflladdr_tag = EVENTHANDLER_REGISTER(iflladdr_event,
 		    arp_iflladdr, NULL, EVENTHANDLER_PRI_ANY);
-	if (IS_DEFAULT_VNET(curvnet))
-		iflladdr_tag = EVENTHANDLER_REGISTER(iflladdr_event,
-		    arp_iflladdr, NULL, EVENTHANDLER_PRI_ANY);
 }
 SYSINIT(arp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, arp_init, 0);



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