Do not shadow our own route twice on Mac if there is no default route. (Fix for issue found during IPv6 default route override testing.)
This commit is contained in:
@@ -57,6 +57,8 @@
|
||||
#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 {
|
||||
@@ -413,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))) {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user