From: Harlan Stenn Date: Thu, 16 Mar 2000 07:40:46 +0000 (-0000) Subject: ChangeLog, ntp_request.c: X-Git-Tag: NTP_4_0_99_J~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8d7aea555ac994ad23b073d2d1b57c5bb3d343e2;p=thirdparty%2Fntp.git ChangeLog, ntp_request.c: * ntpd/ntp_request.c (dns_a): Start cracking the returned information. bk: 38d08ffetW9ggU_xU-DhHbkgXVlf3g --- diff --git a/ChangeLog b/ChangeLog index 106acebc33..282be39ac9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-03-16 Harlan Stenn + + * ntpd/ntp_request.c (dns_a): Start cracking the returned information. + 2000-03-15 Harlan Stenn * ntpd/ntp_resolver.c (ntp_res): Authenticate the keyid. diff --git a/ntpd/ntp_request.c b/ntpd/ntp_request.c index 31cd8e25e5..d5259c843b 100644 --- a/ntpd/ntp_request.c +++ b/ntpd/ntp_request.c @@ -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++; }