diff --git a/node/Node.cpp b/node/Node.cpp index 2e208a426..1934ef7d0 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -493,10 +493,10 @@ int Node::addLocalInterfaceAddress(const struct sockaddr_storage *addr) { if (Path::isAddressValidForPath(*(reinterpret_cast(addr)))) { Mutex::Lock _l(_directPaths_m); - _directPaths.push_back(*(reinterpret_cast(addr))); - std::sort(_directPaths.begin(),_directPaths.end()); - _directPaths.erase(std::unique(_directPaths.begin(),_directPaths.end()),_directPaths.end()); - return 1; + if (std::find(_directPaths.begin(),_directPaths.end(),*(reinterpret_cast(addr))) == _directPaths.end()) { + _directPaths.push_back(*(reinterpret_cast(addr))); + return 1; + } } return 0; }