[Git][NTPsec/ntpsec][master] 2 commits: Fix typos in buildprep
Hal Murray
gitlab at mg.gitlab.com
Mon Apr 10 22:07:10 UTC 2017
Hal Murray pushed to branch master at NTPsec / ntpsec
Commits:
3af6ab6d by Hal Murray at 2017-04-10T02:53:32-07:00
Fix typos in buildprep
- - - - -
2f3e38ba by Hal Murray at 2017-04-10T02:58:51-07:00
Remove force_synchronous_dns and code it enables - never set
- - - - -
3 changed files:
- buildprep
- include/ntp_config.h
- ntpd/ntp_config.c
Changes:
=====================================
buildprep
=====================================
--- a/buildprep
+++ b/buildprep
@@ -209,8 +209,8 @@ doc () {
$install app-text/asciidoc
;;
yum|dnf)
- echo "# Please check that you asciidoc is at least 8.6.0"
- echo "# You may nee to enable EPEL repositories"
+ echo "# Please check that your asciidoc is at least 8.6.0"
+ echo "# You may need to enable EPEL repositories"
$install asciidoc
;;
yast|zypper)
=====================================
include/ntp_config.h
=====================================
--- a/include/ntp_config.h
+++ b/include/ntp_config.h
@@ -33,7 +33,6 @@
/* list of servers from command line for config_peers() */
extern int cmdline_server_count;
extern char ** cmdline_servers;
-extern bool force_synchronous_dns;
typedef struct int_range_tag {
int first;
=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -77,12 +77,9 @@
#define REFCLOCKUNIT(srcadr) (SRCADR(srcadr) & 0xff)
-static bool getaddrinfo_now(char *, sockaddr_u *);
-
/* list of servers from command line for config_peers() */
int cmdline_server_count = 0;
char ** cmdline_servers;
-bool force_synchronous_dns = false;
/*
* FIXME: ugly globals, only created to avoid wiring in option-parsing cruft.
@@ -1459,40 +1456,6 @@ free_config_monitor(
FREE_FILEGEN_FIFO(ptree->filegen_opts);
}
-static
-bool getaddrinfo_now(char *hname, sockaddr_u *peeraddrp)
-{
- int a_info;
- size_t octets;
- struct addrinfo hints, *res;
- ZERO(hints);
- hints.ai_family = AF_UNSPEC;
- hints.ai_socktype = SOCK_DGRAM;
- hints.ai_protocol = IPPROTO_UDP;
- a_info = getaddrinfo(hname, "ntp", &hints, &res);
- if (a_info == EAI_NONAME
-#ifdef EAI_NODATA
- || a_info == EAI_NODATA
-#endif
- ) {
- hints.ai_flags = AI_CANONNAME;
- hints.ai_flags |= AI_ADDRCONFIG;
- a_info = getaddrinfo(hname, "ntp", &hints, &res);
- }
- if (a_info != 0) {
- msyslog(LOG_ERR,
- "hostname %s can not be used (%s), please use IP address.",
- hname, gai_strerror(a_info));
- return false;
- } else {
- INSIST(res != NULL);
- memset(peeraddrp, '\0', sizeof(*peeraddrp));
- octets = min(sizeof(*peeraddrp), res->ai_addrlen);
- memcpy(peeraddrp, res->ai_addr, octets);
- freeaddrinfo(res);
- return true;
- }
-}
static void
config_access(
@@ -2703,15 +2666,6 @@ config_peers(
NULL,
MODE_CLIENT,
&client_ctl);
- } else if (force_synchronous_dns) {
- if (getaddrinfo_now(*cmdline_servers, &peeraddr)) {
- peer_config(
- &peeraddr,
- NULL,
- NULL,
- MODE_CLIENT,
- &client_ctl);
- }
} else {
/* we have a hostname to resolve */
# ifdef USE_WORKER
@@ -2834,15 +2788,6 @@ config_peers(
/*
* synchronous lookup may be forced.
*/
- } else if (force_synchronous_dns) {
- if (getaddrinfo_now(curr_peer->addr->address, &peeraddr)) {
- peer_config(
- &peeraddr,
- NULL,
- NULL,
- hmode,
- &curr_peer->ctl);
- }
} else {
/* hand the hostname off to the blocking child */
# ifdef USE_WORKER
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/de96cee2e2369a2dd1244d89fea992d90deab46a...2f3e38ba6af6103062092a5f6a2e47bcf67c4c97
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170410/5309175a/attachment.html>
More information about the vc
mailing list