diff options
Diffstat (limited to 'src/plugins/lldp/lldp_cli.c')
-rw-r--r-- | src/plugins/lldp/lldp_cli.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/plugins/lldp/lldp_cli.c b/src/plugins/lldp/lldp_cli.c index e77d699393c..1ed3efa4251 100644 --- a/src/plugins/lldp/lldp_cli.c +++ b/src/plugins/lldp/lldp_cli.c @@ -103,7 +103,7 @@ lldp_cfg_intf_set (u32 hw_if_index, u8 ** port_desc, u8 ** mgmt_ip4, } /* Add MAC address to an interface's filter */ - if (hi->caps & VNET_HW_INTERFACE_CAP_SUPPORTS_MAC_FILTER) + if (hi->caps & VNET_HW_IF_CAP_MAC_FILTER) { error = vnet_hw_interface_add_del_mac_address (lm->vnet_main, @@ -130,7 +130,7 @@ lldp_cfg_intf_set (u32 hw_if_index, u8 ** port_desc, u8 ** mgmt_ip4, lldp_intf_t *n = lldp_get_intf (lm, hi->sw_if_index); lldp_delete_intf (lm, n); /* Remove MAC address from the interface's filter */ - if ((n) && (hi->caps & VNET_HW_INTERFACE_CAP_SUPPORTS_MAC_FILTER)) + if ((n) && (hi->caps & VNET_HW_IF_CAP_MAC_FILTER)) { error = vnet_hw_interface_add_del_mac_address (lm->vnet_main, @@ -175,13 +175,13 @@ lldp_intf_cmd (vlib_main_t * vm, unformat_input_t * input, if (unformat (input, "mgmt-ip4 %U", unformat_ip4_address, &ip4_addr)) { vec_validate (mgmt_ip4, sizeof (ip4_address_t) - 1); - clib_memcpy (mgmt_ip4, &ip4_addr, vec_len (mgmt_ip4)); + clib_memcpy (mgmt_ip4, &ip4_addr, sizeof (ip4_addr)); } else if (unformat (input, "mgmt-ip6 %U", unformat_ip6_address, &ip6_addr)) { vec_validate (mgmt_ip6, sizeof (ip6_address_t) - 1); - clib_memcpy (mgmt_ip6, &ip6_addr, vec_len (mgmt_ip6)); + clib_memcpy (mgmt_ip6, &ip6_addr, sizeof (ip6_addr)); } else if (unformat (input, "mgmt-oid %s", &mgmt_oid)) ; @@ -298,7 +298,6 @@ out: return ret; } -/* *INDENT-OFF* */ VLIB_CLI_COMMAND(set_interface_lldp_cmd, static) = { .path = "set interface lldp", .short_help = "set interface lldp <interface> | sw_if_index <idx>" @@ -313,7 +312,6 @@ VLIB_CLI_COMMAND(set_lldp_cmd, static) = { "[tx-interval <value>]", .function = lldp_cfg_cmd, }; -/* *INDENT-ON* */ static const char * lldp_chassis_id_subtype_str (lldp_chassis_id_subtype_t t) @@ -580,7 +578,6 @@ format_lldp_intfs_detail (u8 * s, vlib_main_t * vm, const lldp_main_t * lm) s = format (s, "\nLLDP-enabled interface table:\n"); f64 now = vlib_time_now (vm); - /* *INDENT-OFF* */ pool_foreach ( n, lm->intfs) { hw = vnet_get_hw_interface(vnm, n->hw_if_index); @@ -640,7 +637,6 @@ format_lldp_intfs_detail (u8 * s, vlib_main_t * vm, const lldp_main_t * lm) now, format_time_ago, n->last_heard, now); } } - /* *INDENT-ON* */ return s; } @@ -663,7 +659,6 @@ format_lldp_intfs (u8 * s, va_list * va) "Peer chassis ID", "Remote port ID", "Last heard", "Last sent", "Status"); - /* *INDENT-OFF* */ pool_foreach ( n, lm->intfs) { const vnet_hw_interface_t *hw = @@ -689,7 +684,6 @@ format_lldp_intfs (u8 * s, va_list * va) format_time_ago, n->last_sent, now, "inactive"); } } - /* *INDENT-ON* */ return s; } @@ -710,13 +704,11 @@ show_lldp (vlib_main_t * vm, unformat_input_t * input, return 0; } -/* *INDENT-OFF* */ VLIB_CLI_COMMAND(show_lldp_command, static) = { .path = "show lldp", .short_help = "show lldp [detail]", .function = show_lldp, }; -/* *INDENT-ON* */ /* * packet trace format function, very similar to |