summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_funcs.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2017-01-09 01:00:45 -0800
committerOle Trøan <otroan@employees.org>2017-01-10 14:09:55 +0000
commit75152289284aaf1116d62c6cdef5a3b0c793fa15 (patch)
tree7ced5e87b0db3eabdc5062d1b589d21962116521 /src/vnet/interface_funcs.h
parent553a41190963099631a73fb0a77b07b871d65e70 (diff)
IPv6 NS RS tests and fixes
includes Fix for VPP-584 with API change to remove prefix length from LL programming Change-Id: If860751c35e60255fb977f73bc33e8c2649e728e Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/interface_funcs.h')
-rw-r--r--src/vnet/interface_funcs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vnet/interface_funcs.h b/src/vnet/interface_funcs.h
index b84d151c86d..ab808dfa545 100644
--- a/src/vnet/interface_funcs.h
+++ b/src/vnet/interface_funcs.h
@@ -53,6 +53,14 @@ vnet_get_sw_interface (vnet_main_t * vnm, u32 sw_if_index)
}
always_inline vnet_sw_interface_t *
+vnet_get_sw_interface_safe (vnet_main_t * vnm, u32 sw_if_index)
+{
+ if (!pool_is_free_index (vnm->interface_main.sw_interfaces, sw_if_index))
+ return pool_elt_at_index (vnm->interface_main.sw_interfaces, sw_if_index);
+ return (NULL);
+}
+
+always_inline vnet_sw_interface_t *
vnet_get_hw_sw_interface (vnet_main_t * vnm, u32 hw_if_index)
{
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, hw_if_index);