diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-07-07 16:10:36 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-07-07 16:10:36 -0700 |
commit | 912ee199ede66cf79151a67cabc97b09c475aa1b (patch) | |
tree | c47c63aa906be4de8cdf372fd6274009cc5a83de /osdep | |
parent | b9329dc49ac99a09a7cf9b488904e50ca8e1c4bc (diff) | |
download | infinitytier-912ee199ede66cf79151a67cabc97b09c475aa1b.tar.gz infinitytier-912ee199ede66cf79151a67cabc97b09c475aa1b.zip |
Tiny fixes to LinuxEthernetTap
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/LinuxEthernetTap.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/osdep/LinuxEthernetTap.cpp b/osdep/LinuxEthernetTap.cpp index b10c4cd1..e336bb67 100644 --- a/osdep/LinuxEthernetTap.cpp +++ b/osdep/LinuxEthernetTap.cpp @@ -254,7 +254,7 @@ bool LinuxEthernetTap::removeIp(const InetAddress &ip) if (!ip) return true; std::vector<InetAddress> allIps(ips()); - if (!std::binary_search(allIps.begin(),allIps.end(),ip)) { + if (std::find(allIps.begin(),allIps.end(),ip) != allIps.end()) { if (___removeIp(_dev,ip)) return true; } @@ -294,7 +294,7 @@ std::vector<InetAddress> LinuxEthernetTap::ips() const freeifaddrs(ifa); std::sort(r.begin(),r.end()); - std::unique(r.begin(),r.end()); + r.erase(std::unique(r.begin(),r.end()),r.end()); return r; } @@ -356,7 +356,7 @@ void LinuxEthernetTap::scanMulticastGroups(std::vector<MulticastGroup> &added,st newGroups.push_back(MulticastGroup::deriveMulticastGroupForAddressResolution(*ip)); std::sort(newGroups.begin(),newGroups.end()); - std::unique(newGroups.begin(),newGroups.end()); + newGroups.erase(std::unique(newGroups.begin(),newGroups.end()),newGroups.end()); for(std::vector<MulticastGroup>::iterator m(newGroups.begin());m!=newGroups.end();++m) { if (!std::binary_search(_multicastGroups.begin(),_multicastGroups.end(),*m)) |