X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fethernet%2Fnode.c;h=4ef575a85fc13d58a9503070ad183db102f1d914;hb=5c476e7ac31df0626694376c9a10deeb67bd09bf;hp=cc0a0c30b9c70c3d7ea3ac16b30d9aa947db1bfa;hpb=af7fb04b81c765c3e3f621c6b23fc3390310715b;p=vpp.git diff --git a/src/vnet/ethernet/node.c b/src/vnet/ethernet/node.c index cc0a0c30b9c..4ef575a85fc 100644 --- a/src/vnet/ethernet/node.c +++ b/src/vnet/ethernet/node.c @@ -225,25 +225,24 @@ identify_subint (ethernet_main_t * em, // A unicast packet arriving on an L3 interface must have a dmac // matching the interface mac. If interface has STATUS_L3 bit set // mac filter is already done. - if (!(*is_l2 || (ei->flags & ETHERNET_INTERFACE_FLAG_STATUS_L3))) + if ((!*is_l2) && ei && + (!(ei->flags & ETHERNET_INTERFACE_FLAG_STATUS_L3))) { u64 dmacs[2]; u8 dmacs_bad[2]; ethernet_header_t *e0; - ethernet_interface_t *ei0; e0 = (void *) (b0->data + vnet_buffer (b0)->l2_hdr_offset); dmacs[0] = *(u64 *) e0; - ei0 = ethernet_get_interface (ðernet_main, hi->hw_if_index); - if (ei0 && vec_len (ei0->secondary_addrs)) + if (vec_len (ei->secondary_addrs)) ethernet_input_inline_dmac_check (hi, dmacs, dmacs_bad, - 1 /* n_packets */ , ei0, - 1 /* have_sec_dmac */ ); + 1 /* n_packets */, ei, + 1 /* have_sec_dmac */); else ethernet_input_inline_dmac_check (hi, dmacs, dmacs_bad, - 1 /* n_packets */ , ei0, - 0 /* have_sec_dmac */ ); + 1 /* n_packets */, ei, + 0 /* have_sec_dmac */); if (dmacs_bad[0]) *error0 = ETHERNET_ERROR_L3_MAC_MISMATCH; } @@ -1564,21 +1563,20 @@ ethernet_input_inline (vlib_main_t * vm, dmacs[0] = *(u64 *) e0; - if (ei && vec_len (ei->secondary_addrs)) - ethernet_input_inline_dmac_check (hi, dmacs, - dmacs_bad, - 1 /* n_packets */ , - ei, - 1 /* have_sec_dmac */ ); - else - ethernet_input_inline_dmac_check (hi, dmacs, - dmacs_bad, - 1 /* n_packets */ , - ei, - 0 /* have_sec_dmac */ ); - - if (dmacs_bad[0]) - error0 = ETHERNET_ERROR_L3_MAC_MISMATCH; + if (ei) + { + if (vec_len (ei->secondary_addrs)) + ethernet_input_inline_dmac_check ( + hi, dmacs, dmacs_bad, 1 /* n_packets */, ei, + 1 /* have_sec_dmac */); + else + ethernet_input_inline_dmac_check ( + hi, dmacs, dmacs_bad, 1 /* n_packets */, ei, + 0 /* have_sec_dmac */); + + if (dmacs_bad[0]) + error0 = ETHERNET_ERROR_L3_MAC_MISMATCH; + } skip_dmac_check0: vlib_buffer_advance (b0, sizeof (ethernet_header_t)); @@ -1897,7 +1895,7 @@ ethernet_sw_interface_get_config (vnet_main_t * vnm, } else { - // a specific outer + specifc innner vlan id, a common case + // a specific outer + specific innner vlan id, a common case // get the qinq table if (vlan_table->vlans[si->sub.eth.outer_vlan_id].qinqs == 0)