@ -1610,12 +1610,10 @@ public:
// Nuke applied routes that are no longer in n.config.routes[] and/or are not allowed
for ( std : : list < SharedPtr < ManagedRoute > > : : iterator mr ( n . managedRoutes . begin ( ) ) ; mr ! = n . managedRoutes . end ( ) ; ) {
bool haveRoute = false ;
if ( ( checkIfManagedIsAllowed ( n , ( * mr ) - > target ( ) ) ) & & ( ( ( * mr ) - > via ( ) . ss_family ! = ( * mr ) - > target ( ) . ss_family ) | | ( ! matchIpOnly ( myIps , ( * mr ) - > via ( ) ) ) ) ) {
for ( unsigned int i = 0 ; i < n . config . routeCount ; + + i ) {
const InetAddress * const target = reinterpret_cast < const InetAddress * > ( & ( n . config . routes [ i ] . target ) ) ;
const InetAddress * const via = reinterpret_cast < const InetAddress * > ( & ( n . config . routes [ i ] . via ) ) ;
if ( ( ( * mr ) - > target ( ) = = * target ) & & ( ( ( via - > ss_family = = target - > ss_family ) & & ( ( * mr ) - > via ( ) . ipsEqual ( * via ) ) ) | | ( strcmp ( tapdev , ( * mr ) - > device ( ) ) = = 0 ) ) ) {
haveRoute = true ;
break ;
@ -1640,15 +1638,12 @@ public:
bool haveRoute = false ;
// Ignore routes implied by local managed IPs since adding the IP adds the route
// Commented out to fix ticket #600 (disappearing routes on macOS). Remove this block when we're sure there's no side effects
/*
for ( std : : vector < InetAddress > : : iterator ip ( n . managedIps . begin ( ) ) ; ip ! = n . managedIps . end ( ) ; + + ip ) {
if ( ( target - > netmaskBits ( ) = = ip - > netmaskBits ( ) ) & & ( target - > containsAddress ( * ip ) ) ) {
haveRoute = true ;
break ;
}
}
*/
if ( haveRoute )
continue ;