[Git][NTPsec/ntpsec][master] Address remaing part of GitLab issue #348: unpeer failing on invalid hostname.

Eric S. Raymond gitlab at mg.gitlab.com
Tue Aug 15 16:42:17 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
71f24bd7 by Eric S. Raymond at 2017-08-15T12:39:19-04:00
Address remaing part of GitLab issue #348: unpeer failing on invalid hostname.

This improves on a previous fix for malformed peernames that in retrospect
was the wong thing.

- - - - -


2 changed files:

- ntpd/ntp_config.c
- ntpd/ntp_peer.c


Changes:

=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -2846,12 +2846,6 @@ config_unpeers(
 
 		/* It's not a numeric IP address... */
 
-		/* Misguided attempt to unpeer by driver type name? */
-		if (strchr(name, '.') == NULL && strchr(name, ':') == NULL) {
-		    msyslog(LOG_ERR, "refclocks cannot be unpeered by type.");
-		    continue;
-		}
-
 		/* It's a hostname. */
 		p = findexistingpeer(NULL, name, NULL, -1);
 		if (p != NULL) {


=====================================
ntpd/ntp_peer.c
=====================================
--- a/ntpd/ntp_peer.c
+++ b/ntpd/ntp_peer.c
@@ -253,7 +253,8 @@ findexistingpeer(
 	int		mode)
 {
 	if (hostname != NULL)
-		return findexistingpeer_name(hostname, AF(addr),
+		return findexistingpeer_name(hostname,
+					     (addr == NULL) ? AF_UNSPEC : AF(addr),
 					     start_peer, mode);
 	else
 		return findexistingpeer_addr(addr, start_peer, mode);



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/71f24bd74948f925fb64b8e2b92da154bc16754e

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/71f24bd74948f925fb64b8e2b92da154bc16754e
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/20170815/fed82e9e/attachment.html>


More information about the vc mailing list