diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-07-12 09:22:04 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-07-12 09:22:04 -0700 |
commit | 23391ff9dad8c82858cee8f1bb19ca10bf613bcb (patch) | |
tree | be0dc60768c76ad4e2552fbe5e609ce268d40134 | |
parent | 3f2b21ce71be81ae960a4a6197555a92158a74e3 (diff) | |
download | infinitytier-23391ff9dad8c82858cee8f1bb19ca10bf613bcb.tar.gz infinitytier-23391ff9dad8c82858cee8f1bb19ca10bf613bcb.zip |
More OSX IPv6 fixes.
-rw-r--r-- | osdep/ManagedRoute.cpp | 2 | ||||
-rw-r--r-- | osdep/OSXEthernetTap.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/osdep/ManagedRoute.cpp b/osdep/ManagedRoute.cpp index 88fd944a..ae2f8943 100644 --- a/osdep/ManagedRoute.cpp +++ b/osdep/ManagedRoute.cpp @@ -415,7 +415,7 @@ bool ManagedRoute::sync() // Shadow system route if it exists, also delete any obsolete shadows // and replace them with the new state. sync() is called periodically to // allow us to do that if underlying connectivity changes. - if ( ((_systemVia != newSystemVia)||(!strcmp(_systemDevice,newSystemDevice))) && (strcmp(_device,newSystemDevice)) ) { + if ( ((_systemVia != newSystemVia)||(strcmp(_systemDevice,newSystemDevice))) && (strcmp(_device,newSystemDevice)) ) { if ((_systemVia)&&(_systemDevice[0])) { _routeCmd("delete",leftt,_systemVia,_systemDevice,(const char *)0); _routeCmd("delete",rightt,_systemVia,_systemDevice,(const char *)0); diff --git a/osdep/OSXEthernetTap.cpp b/osdep/OSXEthernetTap.cpp index e8c5c1ea..56934c96 100644 --- a/osdep/OSXEthernetTap.cpp +++ b/osdep/OSXEthernetTap.cpp @@ -474,7 +474,7 @@ bool OSXEthernetTap::addIp(const InetAddress &ip) long cpid = (long)vfork(); if (cpid == 0) { - ::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),ip.isV4() ? "inet" : "inet6",ip.toString().c_str(),"alias",(const char *)0); + ::execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),(ip.ss_family == AF_INET6) ? "inet6" : "inet",ip.toString().c_str(),"alias",(const char *)0); ::_exit(-1); } else if (cpid > 0) { int exitcode = -1; @@ -494,7 +494,7 @@ bool OSXEthernetTap::removeIp(const InetAddress &ip) if (*i == ip) { long cpid = (long)vfork(); if (cpid == 0) { - execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),"inet",ip.toIpString().c_str(),"-alias",(const char *)0); + execl("/sbin/ifconfig","/sbin/ifconfig",_dev.c_str(),(ip.ss_family == AF_INET6) ? "inet6" : "inet",ip.toIpString().c_str(),"-alias",(const char *)0); _exit(-1); } else if (cpid > 0) { int exitcode = -1; |