Merge branch 'dev' of github.com:zerotier/ZeroTierOne into dev

This commit is contained in:
Adam Ierymenko 2021-04-28 16:16:17 -04:00
commit 46a7136b0d
No known key found for this signature in database
GPG Key ID: C8877CF2D7A5D7F3

View File

@ -207,12 +207,6 @@ LinuxEthernetTap::LinuxEthernetTap(
printf("WARNING: ioctl() failed setting up Linux tap device (bring interface up)\n"); printf("WARNING: ioctl() failed setting up Linux tap device (bring interface up)\n");
return; return;
} }
ifr.ifr_flags |= IFF_UP;
if (ioctl(sock,SIOCSIFFLAGS,(void *)&ifr) < 0) {
::close(sock);
printf("WARNING: ioctl() failed setting up Linux tap device (bring interface up)\n");
return;
}
// Some kernel versions seem to require you to yield while the device comes up // Some kernel versions seem to require you to yield while the device comes up
// before they will accept MTU and MAC. For others it doesn't matter, but is // before they will accept MTU and MAC. For others it doesn't matter, but is
@ -235,6 +229,13 @@ LinuxEthernetTap::LinuxEthernetTap(
return; return;
} }
ifr.ifr_flags |= IFF_UP;
if (ioctl(sock,SIOCSIFFLAGS,(void *)&ifr) < 0) {
::close(sock);
printf("WARNING: ioctl() failed setting up Linux tap device (bring interface up)\n");
return;
}
fcntl(_fd,F_SETFL,O_NONBLOCK); fcntl(_fd,F_SETFL,O_NONBLOCK);
::close(sock); ::close(sock);