diff options
author | 2019-08-07 11:46:30 -0500 | |
---|---|---|
committer | 2019-09-18 21:53:10 +0000 | |
commit | da900b25c8fa47c70b4dcba7f2cb68716dcfad46 (patch) | |
tree | 343eb581de97718e26ba64926ef1fe95e5c56a42 /src/vnet/ip/lookup.c | |
parent | f4dcae4164f93dac80d4af19af0ee20e712ec673 (diff) |
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 <mgsmith@netgate.com>
(cherry picked from commit 6c92f5babdc3c52cf343509fc9cf9d8a9a3df390)
Diffstat (limited to 'src/vnet/ip/lookup.c')
-rw-r--r-- | src/vnet/ip/lookup.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |