Skip to content

Commit

Permalink
nl_l3::{add,del}_l3_unicast_route(): retrieve full route for dupe check
Browse files Browse the repository at this point in the history
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: 96e14a8 ("nl_l3: ignore duplicated link routes from FRR")
Signed-off-by: Jonas Gorski <[email protected]>
  • Loading branch information
KanjiMonster committed Nov 13, 2023
1 parent 8f4f95b commit 1672f13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/netlink/nl_l3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1672f13

Please sign in to comment.