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

Allow multiple routes to be added for the same prefix #615

Merged
merged 2 commits into from
May 5, 2021

Conversation

mccv1r0
Copy link
Member

@mccv1r0 mccv1r0 commented Apr 14, 2021

Allow multiple routes to be added for the same prefix.
Enables ECMP

Fixes: #601

@mccv1r0
Copy link
Member Author

mccv1r0 commented Apr 14, 2021

Formally #602 which entered rebase/revendor hell

@dcbw
Copy link
Member

dcbw commented Apr 19, 2021

I think this is right... the only difference between RouteAdd and RouteAddECMP is that RouteAdd() uses the unix.NLM_F_EXCL flag to hard fail if mostly-the-same route is added a second time.

So /lgtm but I have a question or two about the bridge change.

@@ -122,7 +122,7 @@ func calcGateways(result *current.Result, n *NetConf) (*gwInfo, *gwInfo, error)

// Add a default route for this family using the current
// gateway address if necessary.
if n.IsDefaultGW && !gws.defaultRouteFound {
if n.IsDefaultGW {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mccv1r0 is this to allow multiple default routes for the bridge or something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but keeping it seems to behave too, so I added && !gws.defaultRouteFound back.

@dcbw
Copy link
Member

dcbw commented May 5, 2021

/lgtm

@squeed squeed merged commit 8de0287 into containernetworking:master May 5, 2021
Luap99 added a commit to Luap99/netavark that referenced this pull request Nov 5, 2021
The default route will be added for each connected network, so when you
would try to use two networks it would fail because the default route
was already added. While we could ignore eexist error this is not what
we want.
If we only have one route and disconnect the network with the default
route we will loose internet connectivity. To best way is to have each
network create the default route. This can be done by not setting the
NLM_F_EXCL flag for the netlink request.

Also see this CNI bridge plugin PR which does the same there: containernetworking/plugins#615

Signed-off-by: Paul Holzinger <[email protected]>
Luap99 added a commit to Luap99/netavark that referenced this pull request Nov 5, 2021
The default route will be added for each connected network, so when you
would try to use two networks it would fail because the default route
was already added. While we could ignore eexist error this is not what
we want.
If we only have one route and disconnect the network with the default
route we will loose internet connectivity. To best way is to have each
network create the default route. This can be done by not setting the
NLM_F_EXCL flag for the netlink request.

Also see this CNI bridge plugin PR which does the same there: containernetworking/plugins#615

Signed-off-by: Paul Holzinger <[email protected]>
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.

Need support for multiple routes to the same prefix
3 participants