aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/pppoe/pppoe_cp.c
diff options
context:
space:
mode:
authorzstas <zstaseg@gmail.com>2020-05-09 16:57:23 +0000
committerDamjan Marion <dmarion@me.com>2020-10-24 09:53:58 +0000
commit340b10a38ed84600ed3336657ef3a104d9ebe877 (patch)
treef1515e2215be726b6a2d149871fe015b3f550179 /src/plugins/pppoe/pppoe_cp.c
parent58d66743aa2a40d73808eee9dcfec77f78d6e9f3 (diff)
pppoe: make pppoe plugin work with dot1q subinterfaces
- Enabling arc "device-input" with the next node "pppoe-input" on the pppoe cp interface: to get rid of L3_MAC_MISMATCH error - Parsing in the "pppoe-input" node fixed to parse all headers from the scratch - Getting mac address directly from encap interface when filling up DPO adjacency. Anyway, in the case of the dot1q subinterface, we need to get vlan tags to fill the DPO adjacency. Type: improvement Change-Id: I5405931b0f58bef7b852c079a7e66e0da8b5de0f Signed-off-by: Stanislav Zaikin <zstaseg@gmail.com>
Diffstat (limited to 'src/plugins/pppoe/pppoe_cp.c')
-rw-r--r--src/plugins/pppoe/pppoe_cp.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/plugins/pppoe/pppoe_cp.c b/src/plugins/pppoe/pppoe_cp.c
index b99bf79679d..6c6ba249fcc 100644
--- a/src/plugins/pppoe/pppoe_cp.c
+++ b/src/plugins/pppoe/pppoe_cp.c
@@ -17,6 +17,30 @@
#include <pppoe/pppoe.h>
+int
+pppoe_add_del_cp (u32 cp_if_index, u8 is_add)
+{
+ pppoe_main_t *pem = &pppoe_main;
+
+ if (cp_if_index == 0)
+ {
+ return ~0;
+ }
+
+ vnet_feature_enable_disable ("device-input", "pppoe-input",
+ cp_if_index, is_add, 0, 0);
+
+ if (is_add)
+ {
+ pem->cp_if_index = cp_if_index;
+ }
+ else
+ {
+ pem->cp_if_index = ~0;
+ }
+ return 0;
+}
+
static clib_error_t *
pppoe_add_del_cp_command_fn (vlib_main_t * vm,
unformat_input_t * input,
@@ -55,6 +79,9 @@ pppoe_add_del_cp_command_fn (vlib_main_t * vm,
goto done;
}
+ vnet_feature_enable_disable ("device-input", "pppoe-input",
+ cp_if_index, is_add, 0, 0);
+
if (is_add)
{
pem->cp_if_index = cp_if_index;
@@ -74,7 +101,7 @@ done:
VLIB_CLI_COMMAND (create_pppoe_cp_cmd, static) =
{
.path = "create pppoe cp",
- .short_help = "create pppoe cp if-name <intfc> [del]",
+ .short_help = "create pppoe cp-if-index <intfc> [del]",
.function = pppoe_add_del_cp_command_fn,
};
/* *INDENT-ON* */