linux-cp: Fix add vs update on routes 20/39020/2
authorPim van Pelt <pim@ipng.nl>
Sun, 21 May 2023 06:35:26 +0000 (08:35 +0200)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Fri, 9 Jun 2023 19:34:36 +0000 (19:34 +0000)
commit63e76fad7e369746f71305a3c9a88d035ec5cb58
treed9fdd7312b8b09c9695e088d9a15a17e2e3fcfc1
parent1a67c82c843b41d61bd50298597a119ac13174ab
linux-cp: Fix add vs update on routes

Linux uses NLM_F_REPLACE in the netlink message to signal a FIB update
The code invariably does a FIB update for IPv4 and a addition for IPv6.
Without this fix, the following:
 ip route add 2001:db8::/48 via 2001:db8::1
 ip route replace 2001:db8::/48 via 2001:db8::2

ends up as two separate FIB entries in VPP. With the fix, there will be one FIB entry (the second one with nexthop ::2).

Type: fix
Change-Id: I8f98d6ded52ae0c60bfddaa7fc39acbbaa19d34a
Signed-off-by: Pim van Pelt <pim@ipng.nl>
(cherry picked from commit af4fa965e909db69ecde9deb6b7f9a53553aeccb)
src/plugins/linux-cp/lcp_nl.c
src/plugins/linux-cp/lcp_nl.h
src/plugins/linux-cp/lcp_router.c