mirror of
https://github.com/yarrick/iodine.git
synced 2025-04-07 19:12:07 +00:00
Iodine: Cleanup
This commit is contained in:
parent
ae2bd6ea47
commit
563cf30efd
3 changed files with 10 additions and 8 deletions
|
@ -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;
|
||||
|
|
10
src/tun.c
10
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",
|
||||
|
|
|
@ -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_ */
|
||||
|
|
Loading…
Add table
Reference in a new issue