mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-22 02:16:38 +00:00
Revert "Reorder Linux TAP link sequence"
This reverts commit 9374e45449ffe5c377e4cb2a346129ec598eeea9.
This commit is contained in:
parent
cdcd6c4886
commit
b8b1f64959
@ -207,6 +207,12 @@ 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
|
||||||
@ -229,13 +235,6 @@ 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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user