diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-07-12 09:43:12 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-07-12 09:43:12 -0700 |
commit | cdb5ceac7b5a368d777df7f7de4fadb2555fc00a (patch) | |
tree | 9b1a8a1a2f91c040ec60f3e62d91132523247391 /service | |
parent | 23391ff9dad8c82858cee8f1bb19ca10bf613bcb (diff) | |
download | infinitytier-cdb5ceac7b5a368d777df7f7de4fadb2555fc00a.tar.gz infinitytier-cdb5ceac7b5a368d777df7f7de4fadb2555fc00a.zip |
Should remove old IPs before trying to add new ones.
Diffstat (limited to 'service')
-rw-r--r-- | service/OneService.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/service/OneService.cpp b/service/OneService.cpp index 89d9501d..c19b266a 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -1075,18 +1075,18 @@ public: std::sort(newManagedIps.begin(),newManagedIps.end()); newManagedIps.erase(std::unique(newManagedIps.begin(),newManagedIps.end()),newManagedIps.end()); - for(std::vector<InetAddress>::iterator ip(newManagedIps.begin());ip!=newManagedIps.end();++ip) { - if (std::find(n.managedIps.begin(),n.managedIps.end(),*ip) == n.managedIps.end()) { - if (!n.tap->addIp(*ip)) - fprintf(stderr,"ERROR: unable to add ip address %s"ZT_EOL_S, ip->toString().c_str()); - } - } for(std::vector<InetAddress>::iterator ip(n.managedIps.begin());ip!=n.managedIps.end();++ip) { if (std::find(newManagedIps.begin(),newManagedIps.end(),*ip) == newManagedIps.end()) { if (!n.tap->removeIp(*ip)) fprintf(stderr,"ERROR: unable to remove ip address %s"ZT_EOL_S, ip->toString().c_str()); } } + for(std::vector<InetAddress>::iterator ip(newManagedIps.begin());ip!=newManagedIps.end();++ip) { + if (std::find(n.managedIps.begin(),n.managedIps.end(),*ip) == n.managedIps.end()) { + if (!n.tap->addIp(*ip)) + fprintf(stderr,"ERROR: unable to add ip address %s"ZT_EOL_S, ip->toString().c_str()); + } + } n.managedIps.swap(newManagedIps); } |