ip: allow addrs from the same prefix on intf 20/21120/6
authorMatthew Smith <mgsmith@netgate.com>
Wed, 7 Aug 2019 16:46:30 +0000 (11:46 -0500)
committerNeale Ranns <nranns@cisco.com>
Mon, 12 Aug 2019 16:50:54 +0000 (16:50 +0000)
commit6c92f5babdc3c52cf343509fc9cf9d8a9a3df390
tree969249e9836e232929949492f3f45ac5c1deba35
parent79c04d622a55b75de969bf010cdcb820ccfbe816
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>
src/vnet/ip/ip4_forward.c
src/vnet/ip/ip6_forward.c
src/vnet/ip/lookup.c
src/vnet/ip/lookup.h
test/test_ip4.py
test/test_ip6.py