diff --git a/src/client.c b/src/client.c index a361b38..adef407 100644 --- a/src/client.c +++ b/src/client.c @@ -1519,12 +1519,6 @@ handshake_login(int dns_fd, int seed) return 1; } else if (sscanf(in, "%64[^-]-%64[^-]-%d-%d", server, client, &mtu, &netmask) == 4) { - - /** - * Todo: Correct? - */ - if(mtu < 1280) - mtu = 1280; server[64] = 0; client[64] = 0; diff --git a/src/tun.c b/src/tun.c index 3e746ae..30b5ee7 100644 --- a/src/tun.c +++ b/src/tun.c @@ -523,11 +523,19 @@ tun_setip(const char *ip, const char *other_ip, int netbits) } int -tun_setmtu(const unsigned mtu) +tun_setmtu(unsigned mtu) { #ifndef WINDOWS32 char cmdline[512]; + /** + * Todo: Correct? + */ + if(mtu < 1280) { + fprintf(stderr, "Increasing MTU from %u to 1280 (as needed by IPv6)\n", mtu); + mtu = 1280; + } + if (mtu > 200 && mtu <= 1500) { snprintf(cmdline, sizeof(cmdline), IFCONFIGPATH "ifconfig %s mtu %u", diff --git a/src/tun.h b/src/tun.h index 89ffcfa..9fbdae7 100644 --- a/src/tun.h +++ b/src/tun.h @@ -22,6 +22,6 @@ void close_tun(int); int write_tun(int, char *, size_t); ssize_t read_tun(int, char *, size_t); int tun_setip(const char *, const char *, int); -int tun_setmtu(const unsigned); +int tun_setmtu(unsigned); #endif /* _TUN_H_ */