]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Put back the SOCK_DGRAM hints and the "ntp" service into getaddrinfo.
authorDanny Mayer <mayer@ntp.org>
Thu, 31 Jul 2003 02:31:25 +0000 (22:31 -0400)
committerDanny Mayer <mayer@ntp.org>
Thu, 31 Jul 2003 02:31:25 +0000 (22:31 -0400)
Remove the freeaddrinfo() when getaddrinfo fails.

bk: 3f287f7dLiXI4o3R3VW9IgXUvldh6g

ntpd/ntp_config.c

index 1b7fa1d74d30844b601507beb3699b3312e6cbd9..9a126fd1b3073d5233d477d799399818c73135b4 100644 (file)
@@ -2075,11 +2075,12 @@ getnetnum(
        else
            hints.ai_family = AF_UNSPEC;
 
+       hints.ai_socktype = SOCK_DGRAM;
 #ifdef DEBUG
                if (debug > 3)
                        printf("getaddrinfo %s\n", num);
 #endif
-       if (getaddrinfo(num, NULL, &hints, &ptr)!=0) {
+       if (getaddrinfo(num, "ntp", &hints, &ptr)!=0) {
                if (complain)
                        msyslog(LOG_ERR,
                                "getaddrinfo: \"%s\" invalid host address, line ignored",
@@ -2092,7 +2093,6 @@ getnetnum(
                                ? ", line ignored"
                                : "");
 #endif
-                freeaddrinfo(ptr);
                return 0;
        }