mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-08 12:20:10 +00:00
Route re-add patch for linux build on Synology devices
This commit is contained in:
parent
45c4ccb153
commit
57ef31d51c
@ -80,6 +80,10 @@ ifeq ($(ZT_ENABLE_CLUSTER),1)
|
|||||||
DEFS+=-DZT_ENABLE_CLUSTER
|
DEFS+=-DZT_ENABLE_CLUSTER
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(ZT_SYNOLOGY), 1)
|
||||||
|
DEFS+=-D__SYNOLOGY__
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(ZT_TRACE),1)
|
ifeq ($(ZT_TRACE),1)
|
||||||
DEFS+=-DZT_TRACE
|
DEFS+=-DZT_TRACE
|
||||||
endif
|
endif
|
||||||
|
@ -221,8 +221,10 @@ bool LinuxEthernetTap::addIp(const InetAddress &ip)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::vector<InetAddress> allIps(ips());
|
std::vector<InetAddress> allIps(ips());
|
||||||
|
#ifndef __SYNOLOGY__
|
||||||
if (std::binary_search(allIps.begin(),allIps.end(),ip))
|
if (std::binary_search(allIps.begin(),allIps.end(),ip))
|
||||||
return true;
|
return true;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Remove and reconfigure if address is the same but netmask is different
|
// Remove and reconfigure if address is the same but netmask is different
|
||||||
for(std::vector<InetAddress>::iterator i(allIps.begin());i!=allIps.end();++i) {
|
for(std::vector<InetAddress>::iterator i(allIps.begin());i!=allIps.end();++i) {
|
||||||
|
@ -1108,12 +1108,17 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(std::vector<InetAddress>::iterator ip(newManagedIps.begin());ip!=newManagedIps.end();++ip) {
|
for(std::vector<InetAddress>::iterator ip(newManagedIps.begin());ip!=newManagedIps.end();++ip) {
|
||||||
|
#ifdef __SYNOLOGY__
|
||||||
|
if (!n.tap->addIp(*ip))
|
||||||
|
fprintf(stderr,"ERROR: unable to add ip address %s" ZT_EOL_S, ip->toString().c_str());
|
||||||
|
#else
|
||||||
if (std::find(n.managedIps.begin(),n.managedIps.end(),*ip) == n.managedIps.end()) {
|
if (std::find(n.managedIps.begin(),n.managedIps.end(),*ip) == n.managedIps.end()) {
|
||||||
|
|
||||||
if (!n.tap->addIp(*ip))
|
if (!n.tap->addIp(*ip))
|
||||||
fprintf(stderr,"ERROR: unable to add ip address %s" ZT_EOL_S, ip->toString().c_str());
|
fprintf(stderr,"ERROR: unable to add ip address %s" ZT_EOL_S, ip->toString().c_str());
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
n.managedIps.swap(newManagedIps);
|
n.managedIps.swap(newManagedIps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user