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 route deletion when replacing route in hostgw backend #803

merged 2 commits into from Sep 6, 2017


None yet
2 participants

julia-stripe commented Aug 31, 2017


Bug fix for the hostgw backend.

We noticed (#801) that the Flannel was not replacing routes when new nodes were added to the cluster: we saw these error messages in our production cluster

[network.go:83] Subnet added: via\n","stream":"stderr","time":"2017-08-29T17:00:21.968055987Z"}
[network.go:106] Replacing existing route to via with via\n","stream":"stderr","time":"2017-08-29T17:00:21.968211104Z"}
[network.go:108] Error deleting route to no such process\n","stream":"stderr","time":"2017-08-29T17:00:21.96826321Z"}

This was happening when an existing route was being replaced with a new route.

This turns out to be for 2 reasons:

  1. The wrong LinkIndex was being set on the netlink messages: the LinkIndex was always set to 0, when it should be set to the index of the external network interface. (extIface.Iface.Index)
  2. Instead of deleting the old route, this code path was trying to delete the new route. Since the new route doesn't exist, the deletion fails.

I tested Flannel with this patch in our cluster and now replacing routes works correctly.

Fixes #801.


This comment has been minimized.

Show comment
Hide comment

tomdee Sep 6, 2017


Thanks for the fix @julia-stripe . it looks great to me so merging.


tomdee commented Sep 6, 2017

Thanks for the fix @julia-stripe . it looks great to me so merging.

@tomdee tomdee merged commit e1b22bc into coreos:master Sep 6, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

@julia-stripe julia-stripe deleted the julia-stripe:set-link-index branch Sep 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment