Determine MTU automatically

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld
2018-04-18 16:44:05 +02:00
parent ed42e30069
commit 80f22e6c3d
4 changed files with 15 additions and 9 deletions
@@ -73,7 +73,7 @@ public final class GoBackend implements Backend {
private static native void wgTurnOff(int handle);
private static native int wgTurnOn(String ifName, int tunFd, int mtu, String settings);
private static native int wgTurnOn(String ifName, int tunFd, String settings);
@Override
public Config applyConfig(final Tunnel tunnel, final Config config) throws Exception {
@@ -196,7 +196,7 @@ public final class GoBackend implements Backend {
if (tun == null)
throw new Exception("Unable to create tun device");
currentTunnelHandle = wgTurnOn(tunnel.getName(), tun.detachFd(), mtu, fmt.toString());
currentTunnelHandle = wgTurnOn(tunnel.getName(), tun.detachFd(), fmt.toString());
if (currentTunnelHandle < 0)
throw new Exception("Unable to turn tunnel on (wgTurnOn return " + currentTunnelHandle + ")");