This repository was archived by the owner on Jun 12, 2022. It is now read-only.
forked from travelping/upg-vpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0007-ethernet-fix-Ethernet-DMAC-checks.patch
97 lines (86 loc) · 2.99 KB
/
0007-ethernet-fix-Ethernet-DMAC-checks.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
From b9fc3c3bd35a6fa9f1c122c8a7a8aa56a1efdb35 Mon Sep 17 00:00:00 2001
From: Ivan Shvedunov <[email protected]>
Date: Thu, 15 Oct 2020 13:19:35 +0300
Subject: [PATCH 7/7] 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 <[email protected]>
Change-Id: I95209e1ea0f95f9be0b1a82ec9fcbc80955428d2
---
src/vnet/ethernet/node.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/vnet/ethernet/node.c b/src/vnet/ethernet/node.c
index 551754dca..73e9eec71 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,
--
2.28.0