summaryrefslogtreecommitdiff
path: root/osdep
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-04-20 10:08:46 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-04-20 10:08:46 -0700
commitf9ae5938d0f97e3020660bcbd04bc02f91e4b63d (patch)
tree0249fba0a8eb25c22e709f67ad4c09bba793aec9 /osdep
parenta8ced184dc67c5cf39ce1332156c7eb80241768b (diff)
downloadinfinitytier-f9ae5938d0f97e3020660bcbd04bc02f91e4b63d.tar.gz
infinitytier-f9ae5938d0f97e3020660bcbd04bc02f91e4b63d.zip
Makefile fix, only bifurcate routes for default, and release notes.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/ManagedRoute.cpp29
1 files changed, 4 insertions, 25 deletions
diff --git a/osdep/ManagedRoute.cpp b/osdep/ManagedRoute.cpp
index 1fc6c78e..f24b6b34 100644
--- a/osdep/ManagedRoute.cpp
+++ b/osdep/ManagedRoute.cpp
@@ -57,8 +57,6 @@
#define ZT_LINUX_IP_COMMAND "/sbin/ip"
#define ZT_LINUX_IP_COMMAND_2 "/usr/sbin/ip"
-// NOTE: BSD is mostly tested on Apple/Mac but is likely to work on other BSD too
-
namespace ZeroTier {
namespace {
@@ -351,7 +349,7 @@ static bool _winRoute(bool del,const NET_LUID &interfaceLuid,const NET_IFINDEX &
#endif // __WINDOWS__ --------------------------------------------------------
#ifndef ZT_ROUTING_SUPPORT_FOUND
-#error "ManagedRoute.cpp has no support for managing routes on this platform! You'll need to check and see if one of the existing ones will work and make sure proper defines are set, or write one. Please do a Github pull request if you do this for a new OS."
+#error "ManagedRoute.cpp has no support for managing routes on this platform! You'll need to check and see if one of the existing ones will work and make sure proper defines are set, or write one. Please do a GitHub pull request if you do this for a new OS."
#endif
} // anonymous namespace
@@ -378,9 +376,10 @@ bool ManagedRoute::sync()
return false;
#endif
- // Generate two more specific routes than target with one extra bit
InetAddress leftt,rightt;
- _forkTarget(_target,leftt,rightt);
+ if (_target.netmaskBits() == 0) // bifurcate only the default route
+ _forkTarget(_target,leftt,rightt);
+ else leftt = _target;
#ifdef __BSD__ // ------------------------------------------------------------
@@ -447,26 +446,6 @@ bool ManagedRoute::sync()
_routeCmd("change",rightt,_via,(const char *)0,(_via) ? (const char *)0 : _device);
}
- // Create a device-bound default target if there is none in the system. This
- // is to allow e.g. IPv6 default route to work even if there is no native
- // IPv6 on your LAN.
- /*
- if (_target.isDefaultRoute()) {
- if (_systemVia) {
- if (_applied.count(_target)) {
- _applied.erase(_target);
- _routeCmd("delete",_target,_via,_device,(_via) ? (const char *)0 : _device);
- }
- } else {
- if (!_applied.count(_target)) {
- _applied[_target] = true; // ifscoped
- _routeCmd("add",_target,_via,_device,(_via) ? (const char *)0 : _device);
- _routeCmd("change",_target,_via,_device,(_via) ? (const char *)0 : _device);
- }
- }
- }
- */
-
#endif // __BSD__ ------------------------------------------------------------
#ifdef __LINUX__ // ----------------------------------------------------------