aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorIvan Shvedunov <ivan4th@gmail.com>2020-10-15 13:19:35 +0300
committerDamjan Marion <dmarion@me.com>2020-10-15 19:36:08 +0000
commit7286943e7efdbbf99abd8bf318547b2402a4966d (patch)
tree3d884d4a6ef7fab9d8c428c9e7e2963b1af66817 /src/vnet
parentc127d5ad0a9c09b25facabf28288324f125701ad (diff)
ethernet: fix Ethernet DMAC checks
Type: fix Due to confusion between ethernet flags and hw interface flags, DMAC filtering was not happening, most of the time. Signed-off-by: Ivan Shvedunov <ivan4th@gmail.com> Change-Id: I95209e1ea0f95f9be0b1a82ec9fcbc80955428d2
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/ethernet/node.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/vnet/ethernet/node.c b/src/vnet/ethernet/node.c
index 551754dca6d..73e9eec71ae 100644
--- a/src/vnet/ethernet/node.c
+++ b/src/vnet/ethernet/node.c
@@ -204,7 +204,8 @@ ethernet_input_inline_dmac_check (vnet_hw_interface_t * hi,
// vlan table lookups and vlan header parsing. Check the most specific
// matches first.
static_always_inline void
-identify_subint (vnet_hw_interface_t * hi,
+identify_subint (ethernet_main_t * em,
+ vnet_hw_interface_t * hi,
vlib_buffer_t * b0,
u32 match_flags,
main_intf_t * main_intf,
@@ -213,6 +214,7 @@ identify_subint (vnet_hw_interface_t * hi,
u32 * new_sw_if_index, u8 * error0, u32 * is_l2)
{
u32 matched;
+ ethernet_interface_t *ei = ethernet_get_interface (em, hi->hw_if_index);
matched = eth_identify_subint (hi, match_flags, main_intf, vlan_intf,
qinq_intf, new_sw_if_index, error0, is_l2);
@@ -223,7 +225,7 @@ identify_subint (vnet_hw_interface_t * hi,
// 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 || (hi->flags & ETHERNET_INTERFACE_FLAG_STATUS_L3)))
+ if (!(*is_l2 || (ei->flags & ETHERNET_INTERFACE_FLAG_STATUS_L3)))
{
u64 dmacs[2];
u8 dmacs_bad[2];
@@ -1331,7 +1333,7 @@ ethernet_input_inline (vlib_main_t * vm,
}
else
{
- if (hi->flags & ETHERNET_INTERFACE_FLAG_STATUS_L3)
+ if (ei->flags & ETHERNET_INTERFACE_FLAG_STATUS_L3)
goto skip_dmac_check01;
dmacs[0] = *(u64 *) e0;
@@ -1399,14 +1401,16 @@ ethernet_input_inline (vlib_main_t * vm,
&hi1,
&main_intf1, &vlan_intf1, &qinq_intf1);
- identify_subint (hi0,
+ identify_subint (em,
+ hi0,
b0,
match_flags0,
main_intf0,
vlan_intf0,
qinq_intf0, &new_sw_if_index0, &error0, &is_l20);
- identify_subint (hi1,
+ identify_subint (em,
+ hi1,
b1,
match_flags1,
main_intf1,
@@ -1573,7 +1577,7 @@ ethernet_input_inline (vlib_main_t * vm,
}
else
{
- if (hi->flags & ETHERNET_INTERFACE_FLAG_STATUS_L3)
+ if (ei->flags & ETHERNET_INTERFACE_FLAG_STATUS_L3)
goto skip_dmac_check0;
dmacs[0] = *(u64 *) e0;
@@ -1619,7 +1623,8 @@ ethernet_input_inline (vlib_main_t * vm,
&hi0,
&main_intf0, &vlan_intf0, &qinq_intf0);
- identify_subint (hi0,
+ identify_subint (em,
+ hi0,
b0,
match_flags0,
main_intf0,
f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
double-ring-nested.xenial