aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/pppoe/pppoe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/pppoe/pppoe.c')
-rw-r--r--src/plugins/pppoe/pppoe.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/plugins/pppoe/pppoe.c b/src/plugins/pppoe/pppoe.c
index 1589725eddd..0d5f9c1aeac 100644
--- a/src/plugins/pppoe/pppoe.c
+++ b/src/plugins/pppoe/pppoe.c
@@ -77,13 +77,11 @@ pppoe_interface_admin_up_down (vnet_main_t * vnm, u32 hw_if_index, u32 flags)
return /* no error */ 0;
}
-/* *INDENT-OFF* */
VNET_DEVICE_CLASS (pppoe_device_class,static) = {
.name = "PPPoE",
.format_device_name = format_pppoe_name,
.admin_up_down_function = pppoe_interface_admin_up_down,
};
-/* *INDENT-ON* */
static u8 *
format_pppoe_header_with_length (u8 * s, va_list * args)
@@ -256,7 +254,6 @@ pppoe_update_adj (vnet_main_t * vnm, u32 sw_if_index, adj_index_t ai)
dpo_reset (&dpo);
}
-/* *INDENT-OFF* */
VNET_HW_INTERFACE_CLASS (pppoe_hw_class) =
{
.name = "PPPoE",
@@ -265,7 +262,6 @@ VNET_HW_INTERFACE_CLASS (pppoe_hw_class) =
.update_adjacency = pppoe_update_adj,
.flags = VNET_HW_INTERFACE_CLASS_FLAG_P2P,
};
-/* *INDENT-ON* */
#define foreach_copy_field \
_(session_id) \
@@ -353,7 +349,7 @@ int vnet_pppoe_add_del_session
pool_get_aligned (pem->sessions, t, CLIB_CACHE_LINE_BYTES);
clib_memset (t, 0, sizeof (*t));
- clib_memcpy (t->local_mac, hi->hw_address, 6);
+ clib_memcpy (t->local_mac, hi->hw_address, vec_len (hi->hw_address));
/* copy from arg structure */
#define _(x) t->x = a->x;
@@ -374,7 +370,7 @@ int vnet_pppoe_add_del_session
vnet_interface_main_t *im = &vnm->interface_main;
hw_if_index = pem->free_pppoe_session_hw_if_indices
[vec_len (pem->free_pppoe_session_hw_if_indices) - 1];
- _vec_len (pem->free_pppoe_session_hw_if_indices) -= 1;
+ vec_dec_len (pem->free_pppoe_session_hw_if_indices, 1);
hi = vnet_get_hw_interface (vnm, hw_if_index);
hi->dev_instance = t - pem->sessions;
@@ -413,6 +409,8 @@ int vnet_pppoe_add_del_session
si->flags &= ~VNET_SW_INTERFACE_FLAG_HIDDEN;
vnet_sw_interface_set_flags (vnm, sw_if_index,
VNET_SW_INTERFACE_FLAG_ADMIN_UP);
+ vnet_set_interface_l3_output_node (vnm->vlib_main, sw_if_index,
+ (u8 *) "tunnel-output");
/* add reverse route for client ip */
fib_table_entry_path_add (a->decap_fib_index, &pfx,
@@ -431,6 +429,7 @@ int vnet_pppoe_add_del_session
t = pool_elt_at_index (pem->sessions, result.fields.session_index);
sw_if_index = t->sw_if_index;
+ vnet_reset_interface_l3_output_node (vnm->vlib_main, sw_if_index);
vnet_sw_interface_set_flags (vnm, t->sw_if_index, 0 /* down */ );
vnet_sw_interface_t *si = vnet_get_sw_interface (vnm, t->sw_if_index);
si->flags |= VNET_SW_INTERFACE_FLAG_HIDDEN;
@@ -610,7 +609,6 @@ done:
* @cliexcmd{create pppoe session client-ip 10.0.3.1 session-id 13
* client-mac 00:01:02:03:04:05 del }
?*/
-/* *INDENT-OFF* */
VLIB_CLI_COMMAND (create_pppoe_session_command, static) = {
.path = "create pppoe session",
.short_help =
@@ -618,9 +616,7 @@ VLIB_CLI_COMMAND (create_pppoe_session_command, static) = {
" client-mac <client-mac> [decap-vrf-id <nn>] [del]",
.function = pppoe_add_del_session_command_fn,
};
-/* *INDENT-ON* */
-/* *INDENT-OFF* */
static clib_error_t *
show_pppoe_session_command_fn (vlib_main_t * vm,
unformat_input_t * input,
@@ -639,7 +635,6 @@ show_pppoe_session_command_fn (vlib_main_t * vm,
return 0;
}
-/* *INDENT-ON* */
/*?
* Display all the PPPoE Session entries.
@@ -651,13 +646,11 @@ show_pppoe_session_command_fn (vlib_main_t * vm,
* local-mac a0:b0:c0:d0:e0:f0 client-mac 00:01:02:03:04:05
* @cliexend
?*/
-/* *INDENT-OFF* */
VLIB_CLI_COMMAND (show_pppoe_session_command, static) = {
.path = "show pppoe session",
.short_help = "show pppoe session",
.function = show_pppoe_session_command_fn,
};
-/* *INDENT-ON* */
typedef struct pppoe_show_walk_ctx_t_
{
@@ -721,7 +714,7 @@ show_pppoe_fib_command_fn (vlib_main_t * vm,
}
/*?
- * This command dispays the MAC Address entries of the PPPoE FIB table.
+ * This command displays the MAC Address entries of the PPPoE FIB table.
* Output can be filtered to just get the number of MAC Addresses or display
* each MAC Address.
*
@@ -729,18 +722,16 @@ show_pppoe_fib_command_fn (vlib_main_t * vm,
* Example of how to display the number of MAC Address entries in the PPPoE
* FIB table:
* @cliexstart{show pppoe fib}
- * Mac Address session_id Interface sw_if_index session_index
- * 52:54:00:53:18:33 1 GigabitEthernet0/8/0 2 0
- * 52:54:00:53:18:55 2 GigabitEthernet0/8/1 3 1
+ * Mac Address session_id Interface sw_if_index session_index
+ * 52:54:00:53:18:33 1 GigabitEthernet0/8/0 2 0
+ * 52:54:00:53:18:55 2 GigabitEthernet0/8/1 3 1
* @cliexend
?*/
-/* *INDENT-OFF* */
VLIB_CLI_COMMAND (show_pppoe_fib_command, static) = {
.path = "show pppoe fib",
.short_help = "show pppoe fib",
.function = show_pppoe_fib_command_fn,
};
-/* *INDENT-ON* */
clib_error_t *
pppoe_init (vlib_main_t * vm)
@@ -772,12 +763,10 @@ pppoe_init (vlib_main_t * vm)
VLIB_INIT_FUNCTION (pppoe_init);
-/* *INDENT-OFF* */
VLIB_PLUGIN_REGISTER () = {
.version = VPP_BUILD_VER,
.description = "PPP over Ethernet (PPPoE)",
};
-/* *INDENT-ON* */
/*
* fd.io coding-style-patch-verification: ON