mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 20:13:44 +02:00
Another fix for routing and interface issues on MacOS
This commit is contained in:
parent
1b8917a57c
commit
6bb1598fa3
1 changed files with 18 additions and 0 deletions
|
@ -437,6 +437,24 @@ bool ManagedRoute::sync()
|
||||||
|
|
||||||
#ifdef __BSD__ // ------------------------------------------------------------
|
#ifdef __BSD__ // ------------------------------------------------------------
|
||||||
|
|
||||||
|
if (_device[0]) {
|
||||||
|
bool haveDevice = false;
|
||||||
|
struct ifaddrs *ifa = (struct ifaddrs *)0;
|
||||||
|
if (!getifaddrs(&ifa)) {
|
||||||
|
struct ifaddrs *p = ifa;
|
||||||
|
while (p) {
|
||||||
|
if ((p->ifa_name)&&(!strcmp(_device, p->ifa_name))) {
|
||||||
|
haveDevice = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
p = p->ifa_next;
|
||||||
|
}
|
||||||
|
freeifaddrs(ifa);
|
||||||
|
}
|
||||||
|
if (!haveDevice)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Find lowest metric system route that this route should override (if any)
|
// Find lowest metric system route that this route should override (if any)
|
||||||
InetAddress newSystemVia;
|
InetAddress newSystemVia;
|
||||||
char newSystemDevice[128];
|
char newSystemDevice[128];
|
||||||
|
|
Loading…
Add table
Reference in a new issue