[Git][NTPsec/ntpsec][master] 2 commits: Print hostname rather than 0.0.0.0 in protostats/logging

Hal Murray gitlab at mg.gitlab.com
Sat May 9 23:05:11 UTC 2020



Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
bc42ce5f by Hal Murray at 2020-05-08T15:09:42-07:00
Print hostname rather than 0.0.0.0 in protostats/logging

- - - - -
6549d087 by Hal Murray at 2020-05-08T15:11:31-07:00
Fix for some IPv6 servers never sending requests
sock_hash() overflowed 31 bits.

- - - - -


2 changed files:

- ntpd/ntp_control.c
- ntpd/ntp_proto.c


Changes:

=====================================
ntpd/ntp_control.c
=====================================
@@ -4301,6 +4301,9 @@ report_event(
 			src = refclock_name(peer);
 		else
 #endif /* REFCLOCK */
+		if (AF_UNSPEC == AF(&peer->srcadr))
+		    src = peer->hostname;
+		else
 		    src = socktoa(&peer->srcadr);
 
 		snprintf(statstr, sizeof(statstr),


=====================================
ntpd/ntp_proto.c
=====================================
@@ -1299,8 +1299,8 @@ peer_clear(
 	     * to be invisible from outside ntpd; the internal
 	     * association ID fits the bill.
 	     */
-	    int pseudorandom = peer->associd ^ sock_hash(&peer->srcadr);
-	    peer->nextdate += (unsigned long)(pseudorandom % (1 << peer->cfg.minpoll));
+	    unsigned int pseudorand = peer->associd ^ sock_hash(&peer->srcadr);
+	    peer->nextdate += (pseudorand % (1 << peer->cfg.minpoll));
 	}
 	DPRINT(1, ("peer_clear: at %u next %u associd %d refid %s\n",
 		   current_time, peer->nextdate, peer->associd,



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/e886fef94a0c504a0c668ec6770bf29a7e34e208...6549d0878ff9665e8d34fa500b3e2db51689e40b

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/e886fef94a0c504a0c668ec6770bf29a7e34e208...6549d0878ff9665e8d34fa500b3e2db51689e40b
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/20200509/9100b8e8/attachment-0001.htm>


More information about the vc mailing list