diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-02-01 14:02:14 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-02-01 14:02:14 -0800 |
commit | 2a3e646b943724641a5304178109d9b8041bfa36 (patch) | |
tree | 6f303108320e7ee3664c0671cf3105abd0b2c6b8 | |
parent | 64231aa3f0e4dd7cf90fa3a5b8c555f9f39b137b (diff) | |
download | infinitytier-2a3e646b943724641a5304178109d9b8041bfa36.tar.gz infinitytier-2a3e646b943724641a5304178109d9b8041bfa36.zip |
Manually generate IPv6 link-local address only on Mac.
-rw-r--r-- | node/EthernetTap.hpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/node/EthernetTap.hpp b/node/EthernetTap.hpp index 1b35aefb..02bd25ae 100644 --- a/node/EthernetTap.hpp +++ b/node/EthernetTap.hpp @@ -148,15 +148,23 @@ public: for(std::set<InetAddress>::iterator i(allIps.begin());i!=allIps.end();++i) addIP(*i); std::set<InetAddress> myIps(ips()); +#ifdef __APPLE__ bool haveV6LinkLocal = false; for(std::set<InetAddress>::iterator i(myIps.begin());i!=myIps.end();++i) { - if ((i->isV6())&&(i->isLinkLocal())) - haveV6LinkLocal = true; - else if (!allIps.count(*i)) + if (i->isLinkLocal()) { + if (i->isV6()) + haveV6LinkLocal = true; + } else if (!allIps.count(*i)) removeIP(*i); } if (!haveV6LinkLocal) addIP(InetAddress::makeIpv6LinkLocal(_mac)); +#else + for(std::set<InetAddress>::iterator i(myIps.begin());i!=myIps.end();++i) { + if ((!i->isLinkLocal())&&(!allIps.count(*i))) + removeIP(*i); + } +#endif } /** |