Cap configured MTUs at 8937 so relayed sends never outgrow their buffers (#1899)

This commit is contained in:
Jack Doan authored and GitHub committed 2026-10-08 15:41:08 -05:00
1 parent 5bb0622192
commit 13af8dd6f3
18 files changed
+234 -30

No files matched your search

+3 -3
View File
@@ -244,7 +244,7 @@ func newTunGeneric(c *config.C, l *slog.Logger, fd int, vnetHdr bool, offloadFla
}
func (t *tun) reload(c *config.C, initial bool) error {
routeChange, routes, err := getAllRoutesFromConfig(c, t.vpnNetworks, initial)
routeChange, routes, err := getAllRoutesFromConfig(t.l, c, t.vpnNetworks, initial)
if err != nil {
return err
}
@@ -256,7 +256,7 @@ func (t *tun) reload(c *config.C, initial bool) error {
// 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)
_, routes, err = getAllRoutesFromConfig(t.l, c, t.vpnNetworks, true)
if err != nil {
return err
}
@@ -276,7 +276,7 @@ func (t *tun) reload(c *config.C, initial bool) error {
oldDefaultMTU := t.DefaultMTU
oldMaxMTU := t.MaxMTU
newDefaultMTU := c.GetInt("tun.mtu", DefaultMTU)
newDefaultMTU := getMTU(t.l, c)
newMaxMTU := newDefaultMTU
for i, r := range routes {
if r.MTU == 0 {