mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-20 05:13:58 -07:00
some temporary code to make sure it works
This commit is contained in:
parent
d271b270fc
commit
164a33a24f
1 changed files with 15 additions and 0 deletions
|
@ -873,6 +873,8 @@ class OneServiceImpl : public OneService {
|
||||||
|
|
||||||
// Last potential sleep/wake event
|
// Last potential sleep/wake event
|
||||||
uint64_t _lastRestart;
|
uint64_t _lastRestart;
|
||||||
|
char _lastDefaultGateway[255] = {};
|
||||||
|
bool gatewayChanged = false;
|
||||||
|
|
||||||
// Deadline for the next background task service function
|
// Deadline for the next background task service function
|
||||||
volatile int64_t _nextBackgroundTaskDeadline;
|
volatile int64_t _nextBackgroundTaskDeadline;
|
||||||
|
@ -1286,6 +1288,19 @@ class OneServiceImpl : public OneService {
|
||||||
syncManagedStuff(n->second, false, true, false);
|
syncManagedStuff(n->second, false, true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef __APPLE__
|
||||||
|
char buf[255];
|
||||||
|
MacDNSHelper::getDefaultRoute(buf);
|
||||||
|
if (strlen(_lastDefaultGateway) != 0 && strcmp(_lastDefaultGateway, buf) != 0) {
|
||||||
|
gatewayChanged = true;
|
||||||
|
// fprintf(stderr, "gw changed %i\n prev %s new %s", gatewayChanged, _lastDefaultGateway, buf);
|
||||||
|
// TODO do something to send full hello to roots here
|
||||||
|
} else {
|
||||||
|
gatewayChanged = false;
|
||||||
|
}
|
||||||
|
strcpy(_lastDefaultGateway, buf);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run background task processor in core if it's time to do so
|
// Run background task processor in core if it's time to do so
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue