fib: only update glean for interface if necessary 37/40037/2
authorMatthew Smith <mgsmith@netgate.com>
Tue, 26 Sep 2023 13:08:26 +0000 (13:08 +0000)
committerDave Wallace <dwallacelf@gmail.com>
Fri, 1 Dec 2023 19:28:40 +0000 (19:28 +0000)
commit0d7d22cf677c9b88139d907b9c079a7c81afe136
tree99d6cf402d442185ac7c9ee63e059b71367702e7
parent6cc757eff7b8c0d2bfaf6a8061c370d880fa89ca
fib: only update glean for interface if necessary

Type: improvement

If an interface address is added, the glean adjacency for it's covering
prefix is updated with that address. In the case of multiple addresses
within the same prefix being added, the most recently added one will end
up being used as the sender protocol address for ARP requests.

Similar behavior occurs when an interface address is deleted. The glean
adjacency is updated to some appropriate entry under it's covering
prefix. If there were multiple interface addresses configured, we may
update the address on the adjacency even though the address currently in
use is not the one being deleted.

Add a new value PROVIDES_GLEAN to fib_entry_src_flag_t. The flag
identifies whether a source interface entry is being used as the address
for the glean adjacency for the covering prefix.

Update logic so that the glean is only updated on adding an interface
address if there is not already a sibling entry in use which has the
flag set. Also, only update the glean on deleting an interface address
if the address being deleted has the flag set.

Also update unit test which validates expected behavior in the case
where multiple addresses within a prefix are configured on an interface.

Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Change-Id: I7d918b8dd703735b20ec76e0a60af6d7e571b766
(cherry picked from commit 9e5694b405e0200725a993f0c17d452fab508435)
src/vnet/fib/fib_entry.h
src/vnet/fib/fib_entry_src_interface.c
test/test_neighbor.py