From 1672f135e2c2a319c1a40711b3475e2f4c7c94d2 Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Mon, 13 Nov 2023 16:07:38 +0100 Subject: [PATCH] nl_l3::{add,del}_l3_unicast_route(): retrieve full route for dupe check We need to pass RTM_F_FIB_MATCH as flags to RTM_GETROUTE to get the full route, else e.g. the dst will be a /32 resp. /128. Without this, the duplicate route check for filtering out FRR's temporary duplicate on-link routes won't trigger. Fixes: 96e14a879fde ("nl_l3: ignore duplicated link routes from FRR") Signed-off-by: Jonas Gorski --- src/netlink/nl_l3.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/netlink/nl_l3.cc b/src/netlink/nl_l3.cc index 28d36000..fd06589b 100644 --- a/src/netlink/nl_l3.cc +++ b/src/netlink/nl_l3.cc @@ -1765,7 +1765,7 @@ int nl_l3::add_l3_unicast_route(rtnl_route *r, bool update_route) { rtnl_route_get_protocol(r) != RTPROT_KERNEL) { nl_route_query rq; - auto route = rq.query_route(rtnl_route_get_dst(r)); + auto route = rq.query_route(rtnl_route_get_dst(r), RTM_F_FIB_MATCH); if (route) { bool duplicate = false; @@ -1941,7 +1941,7 @@ int nl_l3::del_l3_unicast_route(rtnl_route *r, bool keep_route) { rtnl_route_get_protocol(r) != RTPROT_KERNEL) { nl_route_query rq; - auto route = rq.query_route(rtnl_route_get_dst(r)); + auto route = rq.query_route(rtnl_route_get_dst(r), RTM_F_FIB_MATCH); if (route) { bool duplicate = false;