mirror of
https://github.com/markqvist/tncattach.git
synced 2025-06-25 21:15:23 -04:00
TAP
- Moved mtu check for Ipv6 to be earlier
This commit is contained in:
parent
f61b4a0193
commit
7024d05d0e
16
TAP.c
16
TAP.c
@ -100,14 +100,6 @@ void trySixSet
|
||||
interfaceIndex
|
||||
);
|
||||
|
||||
// linux IPv6 mtu check
|
||||
if(mtu < 1280)
|
||||
{
|
||||
printf("MTU must be 1280 bytes or more for IPv6\n");
|
||||
cleanup();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int dummySock = socket(AF_INET6, SOCK_DGRAM, 0);
|
||||
|
||||
struct in6_ifreq paramReq;
|
||||
@ -318,6 +310,14 @@ int open_tap(void) {
|
||||
|
||||
if(set_ipv6 || link_local_v6)
|
||||
{
|
||||
// linux IPv6 mtu check
|
||||
if(mtu < 1280)
|
||||
{
|
||||
printf("MTU must be 1280 bytes or more for IPv6\n");
|
||||
cleanup();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Firstly, obtain the interface index by `ifr_name`
|
||||
int dummySock = socket(AF_INET6, SOCK_DGRAM, 0);
|
||||
if(ioctl(dummySock, SIOCGIFINDEX, &ifr) < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user