[Git][NTPsec/ntpsec][master] Retry DNS and NTS lookups/probes on SIGHUP
Hal Murray
gitlab at mg.gitlab.com
Wed Dec 11 20:20:40 UTC 2019
Hal Murray pushed to branch master at NTPsec / ntpsec
Commits:
fd40e625 by Hal Murray at 2019-12-11T20:19:22Z
Retry DNS and NTS lookups/probes on SIGHUP
- - - - -
5 changed files:
- docs/includes/ntpd-body.adoc
- include/ntp_dns.h
- ntpd/ntp_io.c
- ntpd/ntp_proto.c
- ntpd/ntpd.c
Changes:
=====================================
docs/includes/ntpd-body.adoc
=====================================
@@ -536,6 +536,7 @@ SIGHUP will reopen the log file if it has changed and
check for a new leapseconds file if one was specified.
If the NTS server is enabled, it will reload the
certificate file if it has changed.
+It will also retry any pending DNS or NTS lookups.
On most systems, you can send SIGHUP to +ntpd+ with
-----
=====================================
include/ntp_dns.h
=====================================
@@ -19,7 +19,7 @@ extern void dns_take_server(struct peer*, sockaddr_u*);
extern void dns_take_pool(struct peer*, sockaddr_u*);
extern void dns_take_status(struct peer*, DNS_Status);
-/* New interface has appeared - try again */
-extern void dns_new_interface(void);
+/* SIGHUP or a new interface has appeared - try again */
+extern void dns_try_again(void);
#endif /* GUARD_NTP_DNS_H */
=====================================
ntpd/ntp_io.c
=====================================
@@ -1263,7 +1263,7 @@ interface_update(
#ifdef DEBUG
msyslog(LOG_DEBUG, "IO: new interface(s) found: waking up resolver");
#endif
- dns_new_interface();
+ dns_try_again();
}
=====================================
ntpd/ntp_proto.c
=====================================
@@ -2537,11 +2537,10 @@ static void restart_nts_ke(struct peer *peer) {
};
/*
- * dns_new_interface
- * A new interface is now active
- * retry danging DNS lookups
+ * dns_try_again
+ * retry danging DNS and NTS lookups
*/
-void dns_new_interface(void) {
+void dns_try_again(void) {
struct peer *p;
for (p = peer_list; p != NULL; p = p->p_link) {
if ((p->cfg.flags & FLAG_LOOKUP) || (p->cast_flags & MDF_POOL)) {
=====================================
ntpd/ntpd.c
=====================================
@@ -954,9 +954,9 @@ static void mainloop(void)
msyslog(LOG_INFO, "LOG: Saw SIGHUP");
reopen_logfile();
-
check_leap_file(false, time(NULL));
check_cert_file();
+ dns_try_again();
}
/*
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/fd40e625df53d59a2e51ec65bcc5df1b9b4a2ba7
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/fd40e625df53d59a2e51ec65bcc5df1b9b4a2ba7
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20191211/9f8bc952/attachment-0001.htm>
More information about the vc
mailing list