-
Notifications
You must be signed in to change notification settings - Fork 988
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
[cert-v2] tun_linux.go: retry setting default MTU #1268
[cert-v2] tun_linux.go: retry setting default MTU #1268
Conversation
…didn't work on the first try
@@ -420,7 +417,20 @@ func (t *tun) setDefaultRoute(cidr netip.Prefix) error { | |||
} | |||
err := netlink.RouteReplace(&nr) | |||
if err != nil { | |||
return fmt.Errorf("failed to set mtu %v on the default route %v; %v", t.DefaultMTU, dr, err) | |||
t.l.WithError(err).WithField("cidr", cidr).Warn("Failed to set default route MTU, retrying") |
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.
The ordering of Activate
changed a good deal, have we tried moving it back to the order it was in to see if that helps this situation?
Lines 328 to 352 in e264a0f
ifrf.Flags = ifrf.Flags | unix.IFF_UP | |
if err = ioctl(t.ioctlFd, unix.SIOCSIFFLAGS, uintptr(unsafe.Pointer(&ifrf))); err != nil { | |
return fmt.Errorf("failed to bring the tun device up: %s", err) | |
} | |
link, err := netlink.LinkByName(t.Device) | |
if err != nil { | |
return fmt.Errorf("failed to get tun device link: %s", err) | |
} | |
t.deviceIndex = link.Attrs().Index | |
if err = t.setDefaultRoute(); err != nil { | |
return err | |
} | |
// Set the routes | |
if err = t.addRoutes(false); err != nil { | |
return err | |
} | |
// Run the interface | |
ifrf.Flags = ifrf.Flags | unix.IFF_UP | unix.IFF_RUNNING | |
if err = ioctl(t.ioctlFd, unix.SIOCSIFFLAGS, uintptr(unsafe.Pointer(&ifrf))); err != nil { | |
return fmt.Errorf("failed to run tun device: %s", err) | |
} |
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.
I fiddled with the ordering and it didn't seem to make a difference.
I think the problem we're seeing here is somehow caused by having more than one IP -- especially an IPv6 IP. When I test with single-IP certs I'm completely unable to reproduce the problem.
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.
Oh also, when this fails it always fails when adding the second route. The first route always works.
No description provided.