Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix duplicate route check for FRR #422

Merged
merged 2 commits into from
Nov 17, 2023
Merged

fix duplicate route check for FRR #422

merged 2 commits into from
Nov 17, 2023

Conversation

KanjiMonster
Copy link
Contributor

By default the kernel replies with an artifical host route when using RTM_GETROUTE. This means that comparing the route's dst with prefix will never be identical, unless the route added is a host route as well. To get the actual route in the kernel, we need to pass RTM_F_FIB_MATCH in the flags. This makes it return the full route including protocol and priority.

Difference via ip:

$ ip route get to 172.16.103.1
172.16.103.1 dev enp2s0 src 172.16.103.202 uid 1000 
    cache 

$ ip route get fibmatch to 172.16.103.1
172.16.103.0/24 dev enp2s0 proto kernel scope link src 172.16.103.202 metric 100 

Fixes: 96e14a8 ("nl_l3: ignore duplicated link routes from FRR")

To support different kind of requests, add the option of passing flags.

Signed-off-by: Jonas Gorski <[email protected]>
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]>
@KanjiMonster KanjiMonster marked this pull request as ready for review November 14, 2023 09:27
@rubensfig rubensfig merged commit 4fa44ec into main Nov 17, 2023
5 checks passed
@rubensfig rubensfig deleted the jogo_fix_frr_workaround branch November 17, 2023 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants