-
Notifications
You must be signed in to change notification settings - Fork 791
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
Conversation
Formally #602 which entered rebase/revendor hell |
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. |
plugins/main/bridge/bridge.go
Outdated
@@ -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 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
/lgtm |
Signed-off-by: Michael Cambria <[email protected]>
Enables ECMP Signed-off-by: Michael Cambria <[email protected]>
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]>
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]>
Allow multiple routes to be added for the same prefix.
Enables ECMP
Fixes: #601