fib: change the order of adding interface routes 89/43589/2
authorArtem Glazychev <[email protected]>
Mon, 18 Aug 2025 04:18:05 +0000 (11:18 +0700)
committerNeale Ranns <[email protected]>
Thu, 28 Aug 2025 02:11:57 +0000 (02:11 +0000)
commit8d41c6f7d84f17c55ec9901f8701371a6eb644e4
treedc452f6afc874e434dfc4fbe358f8bed9f172317
parentf41b05b2f3d5e63f5da019eede04afcc3501252f
fib: change the order of adding interface routes

The order in which fib_table_entry is added affects the update of adjacency. If you assign a /31 address to the interface, an ARP request is sent to the peer with the source address from the glean adjacency, which is incorrect before adding the local address route.
Steps to reproduce the problem:
create tap
set interface state tap0 up
set interface ip address tap0 192.168.100.1/31

In this case, ARP-Request was sent with an incorrect sender IP:
Sender IP Address: 192.168.100.0
Target IP Address: 192.168.100.0

Type: fix

Change-Id: I8712bcf9fd0cb96788fe4a6c4b4827af774c0ab9
Signed-off-by: Artem Glazychev <[email protected]>
src/vnet/ip/ip4_forward.c
src/vnet/ip/ip6_forward.c
test/test_ip4.py