aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/service/ifaceconfig.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-03-08 02:06:07 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-03-08 02:07:46 +0100
commit2d677112997d2dcdccd87e06763d93862ff58641 (patch)
treeac5eee6146d8162d5c3a59beb5d965be246761f4 /service/ifaceconfig.go
parentui: nag (diff)
downloadwireguard-windows-2d677112997d2dcdccd87e06763d93862ff58641.tar.xz
wireguard-windows-2d677112997d2dcdccd87e06763d93862ff58641.zip
ifaceconfig: don't try to set v6 MTUs under 1280
We also constrain v4, but it'd be surprising for that to actually be an issue without something else also being an issue. Reported-by: Thomas Gschwantner <tharre3@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'service/ifaceconfig.go')
-rw-r--r--service/ifaceconfig.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/service/ifaceconfig.go b/service/ifaceconfig.go
index 1bd5f690..edf13ab1 100644
--- a/service/ifaceconfig.go
+++ b/service/ifaceconfig.go
@@ -105,6 +105,9 @@ func monitorDefaultRoutes(device *device.Device, autoMTU bool, guid *windows.GUI
return err
}
iface.NlMtu = mtu - 80
+ if iface.NlMtu < 576 {
+ iface.NlMtu = 576
+ }
err = iface.Set()
if err != nil {
return err
@@ -114,6 +117,9 @@ func monitorDefaultRoutes(device *device.Device, autoMTU bool, guid *windows.GUI
return err
}
iface.NlMtu = mtu - 80
+ if iface.NlMtu < 1280 {
+ iface.NlMtu = 1280
+ }
err = iface.Set()
if err != nil {
return err