summaryrefslogtreecommitdiffstats
path: root/src/plugins/ping
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/ping')
-rw-r--r--src/plugins/ping/ping.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/plugins/ping/ping.c b/src/plugins/ping/ping.c
index 0ce4f9698f0..98add533407 100644
--- a/src/plugins/ping/ping.c
+++ b/src/plugins/ping/ping.c
@@ -18,7 +18,7 @@
#include <vlib/vlib.h>
#include <vnet/fib/ip6_fib.h>
#include <vnet/fib/ip4_fib.h>
-#include <vnet/fib/fib_entry.h>
+#include <vnet/fib/fib_sas.h>
#include <vnet/ip/ip6_link.h>
#include <vnet/plugin/plugin.h>
#include <vpp/app/version.h>
@@ -725,24 +725,22 @@ ip46_fill_l3_header (ip46_address_t * pa46, vlib_buffer_t * b0, int is_ip6)
}
}
-static int
+static bool
ip46_set_src_address (u32 sw_if_index, vlib_buffer_t * b0, int is_ip6)
{
- int res;
+ bool res = false;
+
if (is_ip6)
{
ip6_header_t *ip6 = vlib_buffer_get_current (b0);
- res = ip6_src_address_for_packet (sw_if_index,
- &ip6->dst_address, &ip6->src_address);
+
+ res = fib_sas6_get (sw_if_index, &ip6->dst_address, &ip6->src_address);
}
else
{
- ip4_main_t *im = &ip4_main;
ip4_header_t *ip4 = vlib_buffer_get_current (b0);
- res = ip4_src_address_for_packet (&im->lookup_main,
- sw_if_index, &ip4->src_address);
- /* IP4 and IP6 paths have the inverse logic. Harmonize. */
- res = !res;
+
+ res = fib_sas4_get (sw_if_index, &ip4->dst_address, &ip4->src_address);
}
return res;
}