summaryrefslogtreecommitdiffstats
path: root/src/vnet/ethernet/p2p_ethernet.c
diff options
context:
space:
mode:
authorXiaoming Jiang <jiangxiaoming@outlook.com>2023-05-06 08:22:08 +0000
committerDamjan Marion <dmarion@0xa5.net>2023-05-16 09:28:47 +0000
commite10c5242067b6ad6a9de73ad3b00bfd215202f64 (patch)
tree77bb8d97f1b73089cccc9385d4ad0dfb4bc1b173 /src/vnet/ethernet/p2p_ethernet.c
parent754f79c36a93adf7ef421181526338e0ac4bf763 (diff)
ethernet: fix adding p2p ethernet crash
Type: fix Signed-off-by: Xiaoming Jiang <jiangxiaoming@outlook.com> Change-Id: Ib0ca3379439d6ee23e696f8f0840e6ddf42430b8
Diffstat (limited to 'src/vnet/ethernet/p2p_ethernet.c')
-rw-r--r--src/vnet/ethernet/p2p_ethernet.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/vnet/ethernet/p2p_ethernet.c b/src/vnet/ethernet/p2p_ethernet.c
index ddf23901419..51aba137bf2 100644
--- a/src/vnet/ethernet/p2p_ethernet.c
+++ b/src/vnet/ethernet/p2p_ethernet.c
@@ -153,7 +153,7 @@ p2p_ethernet_add_del (vlib_main_t * vm, u32 parent_if_index,
}
p2pm->p2p_ethernet_by_sw_if_index[parent_if_index]++;
/* set the interface mode */
- set_int_l2_mode (vm, vnm, MODE_L3, p2pe_subif_id, 0,
+ set_int_l2_mode (vm, vnm, MODE_L3, p2pe_sw_if_index, 0,
L2_BD_PORT_TYPE_NORMAL, 0, 0);
return 0;
}
@@ -248,10 +248,11 @@ vnet_p2p_ethernet_add_del (vlib_main_t * vm, unformat_input_t * input,
return 0;
}
-VLIB_CLI_COMMAND (p2p_ethernet_add_del_command, static) =
-{
-.path = "p2p_ethernet ",.function = vnet_p2p_ethernet_add_del,.short_help =
- "p2p_ethernet <intfc> <mac-address> [sub-id <id> | del]",};
+VLIB_CLI_COMMAND (p2p_ethernet_add_del_command, static) = {
+ .path = "p2p_ethernet",
+ .function = vnet_p2p_ethernet_add_del,
+ .short_help = "p2p_ethernet <intfc> <mac-address> [sub-id <id>|del]",
+};
static clib_error_t *
p2p_ethernet_init (vlib_main_t * vm)