aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip-neighbor/ip6_neighbor.c
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2020-11-26 08:37:27 +0000
committerOle Tr�an <otroan@employees.org>2020-12-08 09:00:24 +0000
commite2fe097424fb169dfe01421ff17b8ccd0c26b4a6 (patch)
tree2d9993f78d9165c1aba23b1daa4067106da81b45 /src/vnet/ip-neighbor/ip6_neighbor.c
parent9b8cb5082471dd670066b8ba2872ffbcc35a87f8 (diff)
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 <neale.ranns@cisco.com> Change-Id: I0f3dd1edb1f3fc965af1c7c586709028eb9cdeac
Diffstat (limited to 'src/vnet/ip-neighbor/ip6_neighbor.c')
-rw-r--r--src/vnet/ip-neighbor/ip6_neighbor.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/vnet/ip-neighbor/ip6_neighbor.c b/src/vnet/ip-neighbor/ip6_neighbor.c
index ca67d85778d..478eca7fa27 100644
--- a/src/vnet/ip-neighbor/ip6_neighbor.c
+++ b/src/vnet/ip-neighbor/ip6_neighbor.c
@@ -17,23 +17,19 @@
#include <vnet/ip-neighbor/ip6_neighbor.h>
#include <vnet/util/throttle.h>
+#include <vnet/fib/fib_sas.h>
/** ND throttling */
static throttle_t nd_throttle;
void
-ip6_neighbor_probe_dst (const ip_adjacency_t * adj, const ip6_address_t * dst)
+ip6_neighbor_probe_dst (u32 sw_if_index, const ip6_address_t * dst)
{
- ip_interface_address_t *ia;
- ip6_address_t *src;
+ ip6_address_t src;
- src = ip6_interface_address_matching_destination
- (&ip6_main, dst, adj->rewrite_header.sw_if_index, &ia);
-
- if (!src)
- return;
-
- ip6_neighbor_probe (vlib_get_main (), vnet_get_main (), adj, src, dst);
+ if (fib_sas6_get (sw_if_index, dst, &src))
+ ip6_neighbor_probe (vlib_get_main (), vnet_get_main (),
+ sw_if_index, &src, dst);
}
void
@@ -210,15 +206,15 @@ ip6_discover_neighbor_inline (vlib_main_t * vm,
* Choose source address based on destination lookup
* adjacency.
*/
- if (!ip6_src_address_for_packet (sw_if_index0,
- &ip0->dst_address, &src))
+ if (!fib_sas6_get (sw_if_index0, &ip0->dst_address, &src))
{
/* There is no address on the interface */
p0->error = node->errors[IP6_NBR_ERROR_NO_SOURCE_ADDRESS];
continue;
}
- b0 = ip6_neighbor_probe (vm, vnm, adj0, &src, &ip0->dst_address);
+ b0 = ip6_neighbor_probe (vm, vnm, sw_if_index0,
+ &src, &ip0->dst_address);
if (PREDICT_TRUE (NULL != b0))
{