]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ChangeLog, ntp_request.c:
authorHarlan Stenn <stenn@ntp.org>
Thu, 16 Mar 2000 07:40:46 +0000 (07:40 -0000)
committerHarlan Stenn <stenn@ntp.org>
Thu, 16 Mar 2000 07:40:46 +0000 (07:40 -0000)
  * ntpd/ntp_request.c (dns_a): Start cracking the returned information.

bk: 38d08ffetW9ggU_xU-DhHbkgXVlf3g

ChangeLog
ntpd/ntp_request.c

index 106acebc338d1a6ee39a8b3a58cb9dc71252c151..282be39ac983e8f8de55de320b5d9d5bd8ad23d3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-03-16  Harlan Stenn  <harlan@pfcs.com>
+
+       * ntpd/ntp_request.c (dns_a): Start cracking the returned information.
+
 2000-03-15  Harlan Stenn  <stenn@whimsy.udel.edu>
 
        * ntpd/ntp_resolver.c (ntp_res): Authenticate the keyid.
index 31cd8e25e5642cf533dfdd08e5e000ab509f5c64..d5259c843b1debb1fbfa5fd7c53539ee816ccd6a 100644 (file)
@@ -1234,7 +1234,6 @@ dns_a(
        struct sockaddr_in peeraddr;
        int fl;
 
-       msyslog(LOG_INFO, "dns_a: We're here...");
        /*
         * Do a check of everything to see that it looks
         * okay.  If not, complain about it.  Note we are
@@ -1273,25 +1272,34 @@ dns_a(
                u_short associd;
                size_t hnl;
                char *cp;
+               struct peer *peer;
+               int bogon = 0;
 
-               associd = dp->associd; /* Validate this value? */
+               associd = dp->associd;
+               peer = findpeerbyassoc((int)associd);
+               if (peer == 0 || peer->flags & FLAG_REFCLOCK) {
+                       ++bogon;
+               }
                peeraddr.sin_addr.s_addr = dp->peeraddr;
                for (hnl = 0; *dp->hostname && hnl < sizeof dp->hostname; ++hnl) ;
                if (hnl >= sizeof dp->hostname) {
-                       /* Squawk bad data */
+                       ++bogon;
                }
-               cp = emalloc(hnl + 1);
-               strncpy(cp, dp->hostname, hnl);
+               
+               if (!bogon) {
+                       cp = emalloc(hnl + 1);
+                       strncpy(cp, dp->hostname, hnl);
 
-               msyslog(LOG_INFO, "dns_a: <%s> for %s, AssocID %d",
-                       cp, inet_ntoa(peeraddr.sin_addr), associd);
+                       msyslog(LOG_INFO, "dns_a: <%s> for %s, AssocID %d",
+                               cp, inet_ntoa(peeraddr.sin_addr), associd);
+               }
 
-               /* Do Something in the "if" line to use the info we got */
-               if (0) {
+               if (bogon) {
                        /* If it didn't work */
                        req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
                        return;
                }
+               
                dp++;
        }