From 6c92f5babdc3c52cf343509fc9cf9d8a9a3df390 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Wed, 7 Aug 2019 11:46:30 -0500 Subject: ip: allow addrs from the same prefix on intf Type: feature Adding a prefix to an interface was not permitted if it overlapped with another prefix on an interface which used the same FIB. Loosen the restriction. Allow 2 or more addresses from the same prefix on a single interface. Reference count the prefix to figure out when a glean/connected route for the prefix needs to be added or removed. Added unit tests to check that the route is only removed when all addresses in the prefix are removed from the interface. Change-Id: I1a962ecb5e1ee65fc6d41f98a4cc097a51a55321 Signed-off-by: Matthew Smith --- src/vnet/ip/lookup.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/vnet/ip/lookup.c') diff --git a/src/vnet/ip/lookup.c b/src/vnet/ip/lookup.c index 8c89ed4f490..60cedac57d8 100644 --- a/src/vnet/ip/lookup.c +++ b/src/vnet/ip/lookup.c @@ -207,6 +207,8 @@ ip_lookup_init (ip_lookup_main_t * lm, u32 is_ip6) lm->fib_result_n_bytes = sizeof (uword); lm->is_ip6 = is_ip6; + mhash_init (&lm->prefix_to_if_prefix_index, sizeof (uword), + sizeof (ip_interface_prefix_key_t)); if (is_ip6) { lm->format_address_and_length = format_ip6_address_and_length; -- cgit 1.2.3-korg