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

detect default gateway #1957

Merged
merged 1 commit into from Jan 19, 2021
Merged

detect default gateway #1957

merged 1 commit into from Jan 19, 2021

Conversation

aojea
Copy link
Contributor

@aojea aojea commented Jan 14, 2021

support multipath to detect default gateway

We were detecting the default gateway based in the assumption that
the netlink library was populating the de Gw field with it, however,
it turns out that when multipath is enabled that field is empty and
the corresponding information is in the MultiPath field.

Also, in order to obtain the default gateway, we were dumping all
routes filtering by FAMILY_ALL, and iterating on the results to get
the ones we are interested. We can filter directly by the IP Family instead,
to avoid future possibles problems with the FAMILY_ALL interpretion.

Signed-off-by: Antonio Ojea aojea@redhat.com

xref: https://bugzilla.redhat.com/show_bug.cgi?id=1914250

@aojea
Copy link
Contributor Author

aojea commented Jan 14, 2021

/hold
I want to test it, I have an environment where we can reproduce it

@coveralls
Copy link

coveralls commented Jan 14, 2021

Coverage Status

Coverage decreased (-0.1%) to 54.228% when pulling 175c90c on aojea:defaultgw into b6ff2f7 on ovn-org:master.

@aojea
Copy link
Contributor Author

aojea commented Jan 15, 2021

I´ve verified that it solves the problem
@trozet @dcbw ptal

go-controller/pkg/node/helper_linux.go Show resolved Hide resolved
go-controller/pkg/node/helper_linux.go Outdated Show resolved Hide resolved
go-controller/pkg/node/helper_linux.go Outdated Show resolved Hide resolved
We were detecting the default gateway based in the assumption that
the netlink library was populating the de Gw field with it, however,
it turns out that when multipath is enabled that field is empty and
the corresponding information is in the MultiPath field.

Also, in order to obtain the default gateway, we were dumping all
routes filtering by FAMILY_ALL, and iterating on the results to get
the ones we are interested. We can filter directly by the IP Family instead,
to avoid future possibles problems with the FAMILY_ALL interpretion.

Signed-off-by: Antonio Ojea <aojea@redhat.com>
@girishmg
Copy link
Member

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants