diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-09-13 11:07:59 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-09-13 11:07:59 -0700 |
commit | ced8dfc639f73939aacd2bae3002daa11661a14f (patch) | |
tree | 6089aae71f357ab999ed1ba35111b04fd61721f3 /osdep | |
parent | 8ef0e4bbafbd87c32c62553bd84d87bd0eda0e06 (diff) | |
download | infinitytier-ced8dfc639f73939aacd2bae3002daa11661a14f.tar.gz infinitytier-ced8dfc639f73939aacd2bae3002daa11661a14f.zip |
Try a version of GitHub issue #385 (non-bifurcated default if not present) on Mac. This version adds the bifurcated routes always but also adds a device-specific non-bifurcated route. Will have to see if this still interferes with OSX route settings, since by definition device specific routes should not conflict with general routes.
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/ManagedRoute.cpp | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/osdep/ManagedRoute.cpp b/osdep/ManagedRoute.cpp index 00f95850..711a09ed 100644 --- a/osdep/ManagedRoute.cpp +++ b/osdep/ManagedRoute.cpp @@ -435,36 +435,34 @@ bool ManagedRoute::sync() } } - // if (_systemVia) { - if (!_applied.count(leftt)) { - _applied.insert(leftt); - _routeCmd("add",leftt,_via,(const char *)0,(_via) ? (const char *)0 : _device); - _routeCmd("change",leftt,_via,(const char *)0,(_via) ? (const char *)0 : _device); - } - if ((rightt)&&(!_applied.count(rightt))) { - _applied.insert(rightt); - _routeCmd("add",rightt,_via,(const char *)0,(_via) ? (const char *)0 : _device); - _routeCmd("change",rightt,_via,(const char *)0,(_via) ? (const char *)0 : _device); - } - /*if (_applied.count(_target)) { - _applied.erase(_target); - _routeCmd("delete",_target,_via,(const char *)0,(_via) ? (const char *)0 : _device); - }*/ - /*} else { - if (_applied.count(leftt)) { - _applied.erase(leftt); - _routeCmd("delete",leftt,_via,(const char *)0,(_via) ? (const char *)0 : _device); - } - if ((rightt)&&(_applied.count(rightt))) { - _applied.erase(rightt); - _routeCmd("delete",rightt,_via,(const char *)0,(_via) ? (const char *)0 : _device); - } - if (!_applied.count(_target)) { - _applied.insert(_target); - _routeCmd("add",_target,_via,(const char *)0,(_via) ? (const char *)0 : _device); - _routeCmd("change",_target,_via,(const char *)0,(_via) ? (const char *)0 : _device); + if (!_applied.count(leftt)) { + _applied.insert(leftt); + _routeCmd("add",leftt,_via,(const char *)0,(_via) ? (const char *)0 : _device); + _routeCmd("change",leftt,_via,(const char *)0,(_via) ? (const char *)0 : _device); + } + if ((rightt)&&(!_applied.count(rightt))) { + _applied.insert(rightt); + _routeCmd("add",rightt,_via,(const char *)0,(_via) ? (const char *)0 : _device); + _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.insert(_target); + _routeCmd("add",_target,_via,_device,(_via) ? (const char *)0 : _device); + _routeCmd("change",_target,_via,_device,(_via) ? (const char *)0 : _device); + } } - }*/ + } #endif // __BSD__ ------------------------------------------------------------ |