aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/arp/arp.c2
-rw-r--r--src/vnet/fib/fib_entry.c21
-rw-r--r--src/vnet/fib/fib_entry.h1
3 files changed, 23 insertions, 1 deletions
diff --git a/src/vnet/arp/arp.c b/src/vnet/arp/arp.c
index 6a32229adda..8b57376522d 100644
--- a/src/vnet/arp/arp.c
+++ b/src/vnet/arp/arp.c
@@ -543,7 +543,7 @@ arp_reply (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
dst_fei = ip4_fib_table_lookup (ip4_fib_get (fib_index0),
&arp0->ip4_over_ethernet[1].ip4,
32);
- conn_sw_if_index0 = fib_entry_get_resolving_interface (dst_fei);
+ conn_sw_if_index0 = fib_entry_get_any_resolving_interface (dst_fei);
switch (arp_dst_fib_check (dst_fei, &dst_flags))
{
diff --git a/src/vnet/fib/fib_entry.c b/src/vnet/fib/fib_entry.c
index a8dec1a8c20..33c29a6e33c 100644
--- a/src/vnet/fib/fib_entry.c
+++ b/src/vnet/fib/fib_entry.c
@@ -1464,6 +1464,27 @@ fib_entry_get_resolving_interface (fib_node_index_t entry_index)
return (fib_path_list_get_resolving_interface(fib_entry->fe_parent));
}
+u32
+fib_entry_get_any_resolving_interface (fib_node_index_t entry_index)
+{
+ const fib_entry_src_t *src;
+ fib_entry_t *fib_entry;
+ fib_source_t source;
+ u32 sw_if_index;
+
+ fib_entry = fib_entry_get(entry_index);
+
+ FOR_EACH_SRC_ADDED(fib_entry, src, source,
+ ({
+ sw_if_index = fib_entry_get_resolving_interface_for_source (entry_index,
+ source);
+
+ if (~0 != sw_if_index)
+ break;
+ }));
+ return (sw_if_index);
+}
+
fib_source_t
fib_entry_get_best_source (fib_node_index_t entry_index)
{
diff --git a/src/vnet/fib/fib_entry.h b/src/vnet/fib/fib_entry.h
index b97c80fd8bf..4053ff65181 100644
--- a/src/vnet/fib/fib_entry.h
+++ b/src/vnet/fib/fib_entry.h
@@ -440,6 +440,7 @@ extern u32 fib_entry_child_add(fib_node_index_t fib_entry_index,
extern void fib_entry_child_remove(fib_node_index_t fib_entry_index,
u32 sibling_index);
extern u32 fib_entry_get_resolving_interface(fib_node_index_t fib_entry_index);
+extern u32 fib_entry_get_any_resolving_interface(fib_node_index_t fib_entry_index);
extern u32 fib_entry_get_resolving_interface_for_source(
fib_node_index_t fib_entry_index,
fib_source_t source);