mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02:00
Check for /dev/tun as well as /dev/net/tun since some Linux devices put it there.
This commit is contained in:
parent
9cc2733ed8
commit
7526ed705c
1 changed files with 5 additions and 2 deletions
|
@ -83,8 +83,11 @@ LinuxEthernetTap::LinuxEthernetTap(
|
||||||
throw std::runtime_error("max tap MTU is 2800");
|
throw std::runtime_error("max tap MTU is 2800");
|
||||||
|
|
||||||
_fd = ::open("/dev/net/tun",O_RDWR);
|
_fd = ::open("/dev/net/tun",O_RDWR);
|
||||||
if (_fd <= 0)
|
if (_fd <= 0) {
|
||||||
throw std::runtime_error(std::string("could not open TUN/TAP device: ") + strerror(errno));
|
_fd = ::open("/dev/tun",O_RDWR);
|
||||||
|
if (_fd <= 0)
|
||||||
|
throw std::runtime_error(std::string("could not open TUN/TAP device: ") + strerror(errno));
|
||||||
|
}
|
||||||
|
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
memset(&ifr,0,sizeof(ifr));
|
memset(&ifr,0,sizeof(ifr));
|
||||||
|
|
Loading…
Add table
Reference in a new issue