Deleted Added
full compact
if_ethersubr.c (154518) if_ethersubr.c (155051)
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 154518 2006-01-18 14:24:39Z andre $
30 * $FreeBSD: head/sys/net/if_ethersubr.c 155051 2006-01-30 13:45:15Z glebius $
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"

--- 579 unchanged lines hidden (view full) ---

618
619#if defined(INET) || defined(INET6)
620 if (rule) /* packet was already bridged */
621 goto post_stats;
622#endif
623
624 if (!(ifp->if_bridge) &&
625 !((ether_type == ETHERTYPE_VLAN || m->m_flags & M_VLANTAG) &&
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"

--- 579 unchanged lines hidden (view full) ---

618
619#if defined(INET) || defined(INET6)
620 if (rule) /* packet was already bridged */
621 goto post_stats;
622#endif
623
624 if (!(ifp->if_bridge) &&
625 !((ether_type == ETHERTYPE_VLAN || m->m_flags & M_VLANTAG) &&
626 ifp->if_nvlans > 0)) {
626 ifp->if_vlantrunk != NULL)) {
627#ifdef DEV_CARP
628 /*
629 * XXX: Okay, we need to call carp_forus() and - if it is for
630 * us jump over code that does the normal check
631 * "IF_LLADDR(ifp) == ether_dhost". The check sequence is a bit
632 * different from OpenBSD, so we jump over as few code as
633 * possible, to catch _all_ sanity checks. This needs
634 * evaluation, to see if the carp ether_dhost values break any

--- 56 unchanged lines hidden (view full) ---

691 /*
692 * Check to see if the device performed the VLAN decapsulation and
693 * provided us with the tag.
694 */
695 if (m->m_flags & M_VLANTAG) {
696 /*
697 * If no VLANs are configured, drop.
698 */
627#ifdef DEV_CARP
628 /*
629 * XXX: Okay, we need to call carp_forus() and - if it is for
630 * us jump over code that does the normal check
631 * "IF_LLADDR(ifp) == ether_dhost". The check sequence is a bit
632 * different from OpenBSD, so we jump over as few code as
633 * possible, to catch _all_ sanity checks. This needs
634 * evaluation, to see if the carp ether_dhost values break any

--- 56 unchanged lines hidden (view full) ---

691 /*
692 * Check to see if the device performed the VLAN decapsulation and
693 * provided us with the tag.
694 */
695 if (m->m_flags & M_VLANTAG) {
696 /*
697 * If no VLANs are configured, drop.
698 */
699 if (ifp->if_nvlans == 0) {
699 if (ifp->if_vlantrunk == NULL) {
700 ifp->if_noproto++;
701 m_freem(m);
702 return;
703 }
704 /*
705 * vlan_input() will either recursively call ether_input()
706 * or drop the packet.
707 */
708 KASSERT(vlan_input_p != NULL,("ether_input: VLAN not loaded!"));
709 (*vlan_input_p)(ifp, m);
710 return;
711 }
712
713 /*
714 * Handle protocols that expect to have the Ethernet header
715 * (and possibly FCS) intact.
716 */
717 switch (ether_type) {
718 case ETHERTYPE_VLAN:
700 ifp->if_noproto++;
701 m_freem(m);
702 return;
703 }
704 /*
705 * vlan_input() will either recursively call ether_input()
706 * or drop the packet.
707 */
708 KASSERT(vlan_input_p != NULL,("ether_input: VLAN not loaded!"));
709 (*vlan_input_p)(ifp, m);
710 return;
711 }
712
713 /*
714 * Handle protocols that expect to have the Ethernet header
715 * (and possibly FCS) intact.
716 */
717 switch (ether_type) {
718 case ETHERTYPE_VLAN:
719 if (ifp->if_nvlans != 0) {
719 if (ifp->if_vlantrunk != NULL) {
720 KASSERT(vlan_input_p,("ether_input: VLAN not loaded!"));
721 (*vlan_input_p)(ifp, m);
722 } else {
723 ifp->if_noproto++;
724 m_freem(m);
725 }
726 return;
727 }

--- 460 unchanged lines hidden ---
720 KASSERT(vlan_input_p,("ether_input: VLAN not loaded!"));
721 (*vlan_input_p)(ifp, m);
722 } else {
723 ifp->if_noproto++;
724 m_freem(m);
725 }
726 return;
727 }

--- 460 unchanged lines hidden ---