ip: allow addrs from the same prefix on intf 32/22132/1
authorMatthew Smith <[email protected]>
Wed, 7 Aug 2019 16:46:30 +0000 (11:46 -0500)
committerAndrew Yourtchenko <[email protected]>
Wed, 18 Sep 2019 21:53:10 +0000 (21:53 +0000)
commitda900b25c8fa47c70b4dcba7f2cb68716dcfad46
tree343eb581de97718e26ba64926ef1fe95e5c56a42
parentf4dcae4164f93dac80d4af19af0ee20e712ec673
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 <[email protected]>
(cherry picked from commit 6c92f5babdc3c52cf343509fc9cf9d8a9a3df390)
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