Packets recieved on VLAN-0 map to the main interface
[vpp.git] / src / vnet / ethernet / node.c
index f7787ed..8967ceb 100755 (executable)
@@ -142,6 +142,8 @@ parse_header (ethernet_input_variant_t variant,
       tag = clib_net_to_host_u16 (h0->priority_cfi_and_id);
 
       *outer_id = tag & 0xfff;
+      if (0 == *outer_id)
+       *match_flags &= ~SUBINT_CONFIG_MATCH_1_TAG;
 
       *type = clib_net_to_host_u16 (h0->type);
 
@@ -249,7 +251,7 @@ determine_next_node (ethernet_main_t * em,
     {
       *next0 = em->l3_next.input_next_ip6;
     }
-  else if (type0 == ETHERNET_TYPE_MPLS_UNICAST)
+  else if (type0 == ETHERNET_TYPE_MPLS)
     {
       *next0 = em->l3_next.input_next_mpls;
 
@@ -412,9 +414,11 @@ ethernet_input_inline (vlib_main_t * vm,
              else
                {
                  if (!ethernet_address_cast (e0->dst_address) &&
+                     (hi->hw_address != 0) &&
                      !eth_mac_equal ((u8 *) e0, hi->hw_address))
                    error0 = ETHERNET_ERROR_L3_MAC_MISMATCH;
                  if (!ethernet_address_cast (e1->dst_address) &&
+                     (hi->hw_address != 0) &&
                      !eth_mac_equal ((u8 *) e1, hi->hw_address))
                    error1 = ETHERNET_ERROR_L3_MAC_MISMATCH;
                  determine_next_node (em, variant, 0, type0, b0,
@@ -628,6 +632,7 @@ ethernet_input_inline (vlib_main_t * vm,
              else
                {
                  if (!ethernet_address_cast (e0->dst_address) &&
+                     (hi->hw_address != 0) &&
                      !eth_mac_equal ((u8 *) e0, hi->hw_address))
                    error0 = ETHERNET_ERROR_L3_MAC_MISMATCH;
                  determine_next_node (em, variant, 0, type0, b0,
@@ -1252,7 +1257,7 @@ next_by_ethertype_register (next_by_ethertype_t * l3_next,
        {
          l3_next->input_next_ip6 = next_index;
        }
-      else if (ethertype == ETHERNET_TYPE_MPLS_UNICAST)
+      else if (ethertype == ETHERNET_TYPE_MPLS)
        {
          l3_next->input_next_mpls = next_index;
        }