From e2fe097424fb169dfe01421ff17b8ccd0c26b4a6 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Thu, 26 Nov 2020 08:37:27 +0000 Subject: fib: Source Address Selection Type: feature Use the FIB to provide SAS (in so far as it is today) - Use the glean adjacency as the record of the connected prefixes = there's a glean per-{interface, protocol, connected-prefix} - Keep the glean up to date with whatever the recieve host prefix is (since it can change) Signed-off-by: Neale Ranns Change-Id: I0f3dd1edb1f3fc965af1c7c586709028eb9cdeac --- src/plugins/vrrp/vrrp_packet.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/plugins/vrrp/vrrp_packet.c') diff --git a/src/plugins/vrrp/vrrp_packet.c b/src/plugins/vrrp/vrrp_packet.c index 6b0d4c96c2d..b77f336930a 100644 --- a/src/plugins/vrrp/vrrp_packet.c +++ b/src/plugins/vrrp/vrrp_packet.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -107,8 +108,7 @@ vrrp_adv_l3_build (vrrp_vr_t * vr, vlib_buffer_t * b, ip4->ttl = 255; ip4->protocol = IP_PROTOCOL_VRRP; clib_memcpy (&ip4->dst_address, &dst->ip4, sizeof (dst->ip4)); - ip4_src_address_for_packet (&ip4_main.lookup_main, - vr->config.sw_if_index, &ip4->src_address); + fib_sas4_get (vr->config.sw_if_index, NULL, &ip4->src_address); ip4->length = clib_host_to_net_u16 (sizeof (*ip4) + vrrp_adv_payload_len (vr)); ip4->checksum = ip4_header_checksum (ip4); @@ -541,8 +541,7 @@ vrrp_igmp_pkt_build (vrrp_vr_t * vr, vlib_buffer_t * b) ip4 = vlib_buffer_get_current (b); clib_memcpy (ip4, &igmp_ip4_mcast, sizeof (*ip4)); - ip4_src_address_for_packet (&ip4_main.lookup_main, vr->config.sw_if_index, - &ip4->src_address); + fib_sas4_get (vr->config.sw_if_index, NULL, &ip4->src_address); vlib_buffer_chain_increase_length (b, b, sizeof (*ip4)); vlib_buffer_advance (b, sizeof (*ip4)); -- cgit 1.2.3-korg