if_ethersubr.c (167816) | if_ethersubr.c (168561) |
---|---|
1/*- 2 * Copyright (c) 1982, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 | 1/*- 2 * Copyright (c) 1982, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93 |
30 * $FreeBSD: head/sys/net/if_ethersubr.c 167816 2007-03-22 19:08:39Z bms $ | 30 * $FreeBSD: head/sys/net/if_ethersubr.c 168561 2007-04-10 00:27:25Z thompsa $ |
31 */ 32 33#include "opt_atalk.h" 34#include "opt_inet.h" 35#include "opt_inet6.h" 36#include "opt_ipx.h" 37#include "opt_mac.h" 38#include "opt_netgraph.h" --- 69 unchanged lines hidden (view full) --- 108void (*vlan_input_p)(struct ifnet *, struct mbuf *); 109 110/* if_bridge(4) support */ 111struct mbuf *(*bridge_input_p)(struct ifnet *, struct mbuf *); 112int (*bridge_output_p)(struct ifnet *, struct mbuf *, 113 struct sockaddr *, struct rtentry *); 114void (*bridge_dn_p)(struct mbuf *, struct ifnet *); 115 | 31 */ 32 33#include "opt_atalk.h" 34#include "opt_inet.h" 35#include "opt_inet6.h" 36#include "opt_ipx.h" 37#include "opt_mac.h" 38#include "opt_netgraph.h" --- 69 unchanged lines hidden (view full) --- 108void (*vlan_input_p)(struct ifnet *, struct mbuf *); 109 110/* if_bridge(4) support */ 111struct mbuf *(*bridge_input_p)(struct ifnet *, struct mbuf *); 112int (*bridge_output_p)(struct ifnet *, struct mbuf *, 113 struct sockaddr *, struct rtentry *); 114void (*bridge_dn_p)(struct mbuf *, struct ifnet *); 115 |
116/* if_trunk(4) support */ 117struct mbuf *(*trunk_input_p)(struct ifnet *, struct mbuf *); 118 |
|
116static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] = 117 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; 118 119static int ether_resolvemulti(struct ifnet *, struct sockaddr **, 120 struct sockaddr *); 121 122/* XXX: should be in an arp support file, not here */ 123MALLOC_DEFINE(M_ARPCOM, "arpcom", "802.* interface internals"); --- 473 unchanged lines hidden (view full) --- 597 ifp->if_ibytes += m->m_pkthdr.len; 598 599 /* Allow monitor mode to claim this frame, after stats are updated. */ 600 if (ifp->if_flags & IFF_MONITOR) { 601 m_freem(m); 602 return; 603 } 604 | 119static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] = 120 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; 121 122static int ether_resolvemulti(struct ifnet *, struct sockaddr **, 123 struct sockaddr *); 124 125/* XXX: should be in an arp support file, not here */ 126MALLOC_DEFINE(M_ARPCOM, "arpcom", "802.* interface internals"); --- 473 unchanged lines hidden (view full) --- 600 ifp->if_ibytes += m->m_pkthdr.len; 601 602 /* Allow monitor mode to claim this frame, after stats are updated. */ 603 if (ifp->if_flags & IFF_MONITOR) { 604 m_freem(m); 605 return; 606 } 607 |
608 /* Handle input from a trunk(4) port */ 609 if (ifp->if_type == IFT_IEEE8023ADLAG) { 610 KASSERT(trunk_input_p != NULL, 611 ("%s: if_trunk not loaded!", __func__)); 612 m = (*trunk_input_p)(ifp, m); 613 if (m != NULL) 614 ifp = m->m_pkthdr.rcvif; 615 else 616 return; 617 } 618 |
|
605 /* 606 * If the hardware did not process an 802.1Q tag, do this now, 607 * to allow 802.1P priority frames to be passed to the main input 608 * path correctly. 609 * TODO: Deal with Q-in-Q frames, but not arbitrary nesting levels. 610 */ 611 if ((m->m_flags & M_VLANTAG) == 0 && etype == ETHERTYPE_VLAN) { 612 struct ether_vlan_header *evl; --- 636 unchanged lines hidden --- | 619 /* 620 * If the hardware did not process an 802.1Q tag, do this now, 621 * to allow 802.1P priority frames to be passed to the main input 622 * path correctly. 623 * TODO: Deal with Q-in-Q frames, but not arbitrary nesting levels. 624 */ 625 if ((m->m_flags & M_VLANTAG) == 0 && etype == ETHERTYPE_VLAN) { 626 struct ether_vlan_header *evl; --- 636 unchanged lines hidden --- |