ipsec: IPSec protection for multi-point tunnel interfaces
[vpp.git] / src / vnet / lldp / lldp_cli.c
index ddedd13..5f63e4a 100644 (file)
@@ -18,6 +18,7 @@
  * @brief LLDP CLI handling
  *
  */
+#include <vnet/ethernet/ethernet.h>
 #include <vnet/lisp-cp/lisp_types.h>
 #include <vnet/lldp/lldp.h>
 #include <vnet/lldp/lldp_node.h>
@@ -49,9 +50,16 @@ lldp_cfg_intf_set (u32 hw_if_index, u8 ** port_desc, u8 ** mgmt_ip4,
   lldp_main_t *lm = &lldp_main;
   vnet_main_t *vnm = lm->vnet_main;
   ethernet_main_t *em = &ethernet_main;
-  const vnet_hw_interface_t *hi = vnet_get_hw_interface (vnm, hw_if_index);
-  const ethernet_interface_t *eif = ethernet_get_interface (em, hw_if_index);
+  const vnet_hw_interface_t *hi;
+  const ethernet_interface_t *eif;
 
+  if (pool_is_free_index (vnm->interface_main.hw_interfaces, hw_if_index))
+    {
+      return lldp_invalid_arg;
+    }
+
+  hi = vnet_get_hw_interface (vnm, hw_if_index);
+  eif = ethernet_get_interface (em, hw_if_index);
   if (!eif)
     {
       return lldp_not_supported;
@@ -88,13 +96,12 @@ lldp_cfg_intf_set (u32 hw_if_index, u8 ** port_desc, u8 ** mgmt_ip4,
       if (mgmt_oid && *mgmt_oid)
        {
          n->mgmt_oid = *mgmt_oid;
-         *mgmt_ip6 = NULL;
+         *mgmt_oid = NULL;
        }
 
       const vnet_sw_interface_t *sw =
        vnet_get_sw_interface (lm->vnet_main, hi->sw_if_index);
-      if (sw->flags & (VNET_SW_INTERFACE_FLAG_ADMIN_UP |
-                      VNET_SW_INTERFACE_FLAG_BOND_SLAVE))
+      if (sw->flags & (VNET_SW_INTERFACE_FLAG_ADMIN_UP))
        {
          lldp_schedule_intf (lm, n);
        }
@@ -569,8 +576,7 @@ format_lldp_intfs_detail (u8 * s, vlib_main_t * vm, const lldp_main_t * lm)
           }
 
         /* Interface shutdown */
-        if (!(sw->flags & (VNET_SW_INTERFACE_FLAG_ADMIN_UP |
-                           VNET_SW_INTERFACE_FLAG_BOND_SLAVE)))
+        if (!(sw->flags & VNET_SW_INTERFACE_FLAG_ADMIN_UP))
           {
             s = format(s, "Interface/peer state: interface down\n"
                        "Last packet sent: %U\n",