add NTP time synchronization module

This commit is contained in:
Evgeny committed 2026-07-14 20:14:00 +03:00
1 parent f3719a28df
commit 1a0229fd4f
8 files changed
+385 -2

No files matched your search

+9 -1
View File
@@ -369,6 +369,9 @@ void utun_instance_destroy(struct UTUN_INSTANCE *instance) {
// Stop running if not already
instance->running = 0;
// Cancel NTP timer
ntp_time_destroy(instance);
// Shutdown message transport server
if (instance->msg_t) {
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "Shutting down message transport server");
@@ -608,7 +611,12 @@ int utun_instance_init(struct UTUN_INSTANCE *instance) {
// Start the main loop
instance->running = 1;
// Initialize NTP time sync (non-fatal if fails)
if (ntp_time_init(instance) != 0) {
DEBUG_WARN(DEBUG_CATEGORY_GENERAL, "NTP time sync init failed (non-fatal)");
}
DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "Connections initialized successfully");
return 0;
}