aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/lookup.c
diff options
context:
space:
mode:
authorMatthew Smith <mgsmith@netgate.com>2019-08-07 11:46:30 -0500
committerNeale Ranns <nranns@cisco.com>2019-08-12 16:50:54 +0000
commit6c92f5babdc3c52cf343509fc9cf9d8a9a3df390 (patch)
tree969249e9836e232929949492f3f45ac5c1deba35 /src/vnet/ip/lookup.c
parent79c04d622a55b75de969bf010cdcb820ccfbe816 (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>
Diffstat (limited to 'src/vnet/ip/lookup.c')
-rw-r--r--src/vnet/ip/lookup.c2
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;