Fix for GitHub issue #36 on OSX... results in a duplicate entry for IPv6 link-local but seems okay... need to test on OSX 10.6 though.

This commit is contained in:
Adam Ierymenko 2014-01-31 15:55:45 -08:00
commit 64231aa3f0
3 changed files with 102 additions and 21 deletions

View file

@ -148,10 +148,15 @@ public:
for(std::set<InetAddress>::iterator i(allIps.begin());i!=allIps.end();++i)
addIP(*i);
std::set<InetAddress> myIps(ips());
bool haveV6LinkLocal = false;
for(std::set<InetAddress>::iterator i(myIps.begin());i!=myIps.end();++i) {
if (!allIps.count(*i))
if ((i->isV6())&&(i->isLinkLocal()))
haveV6LinkLocal = true;
else if (!allIps.count(*i))
removeIP(*i);
}
if (!haveV6LinkLocal)
addIP(InetAddress::makeIpv6LinkLocal(_mac));
}
/**