mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-19 21:03:57 -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
|
||||
uint64_t _lastRestart;
|
||||
char _lastDefaultGateway[255] = {};
|
||||
bool gatewayChanged = false;
|
||||
|
||||
// Deadline for the next background task service function
|
||||
volatile int64_t _nextBackgroundTaskDeadline;
|
||||
|
@ -1286,6 +1288,19 @@ class OneServiceImpl : public OneService {
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue