overlay/linux: Keep unsafe routes when a reload only changes tun.mtu (#1918)

This commit is contained in:
Nate Brown authored and GitHub committed 2026-10-07 10:43:11 -05:00
1 parent 8d8ae0f744
commit f57539a163
2 files changed
+66 -1

No files matched your search

+10 -1
View File
@@ -253,6 +253,15 @@ func (t *tun) reload(c *config.C, initial bool) error {
return nil
}
// Only the mtu changed. The routes are the same, parse them again so the ones without their own mtu pick up the
// new default. Without this an mtu change would remove them all
if !routeChange {
_, routes, err = getAllRoutesFromConfig(c, t.vpnNetworks, true)
if err != nil {
return err
}
}
routeTree, err := makeRouteTree(t.l, routes, true)
if err != nil {
return err
@@ -274,7 +283,7 @@ func (t *tun) reload(c *config.C, initial bool) error {
routes[i].MTU = newDefaultMTU
}
if r.MTU > t.MaxMTU {
if r.MTU > newMaxMTU {
newMaxMTU = r.MTU
}
}