[Git][NTPsec/ntpsec][master] Back out my last two commits, wrong stuff got included in them.

Eric S. Raymond gitlab at mg.gitlab.com
Tue Dec 15 13:52:37 UTC 2015


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
92d36808 by Eric S. Raymond at 2015-12-15T08:51:34Z
Back out my last two commits, wrong stuff got included in them.

- - - - -


3 changed files:

- ntpd/ntp_intercept.c
- ntpd/ntp_proto.c
- ntpd/ntpd.c


Changes:

=====================================
ntpd/ntp_intercept.c
=====================================
--- a/ntpd/ntp_intercept.c
+++ b/ntpd/ntp_intercept.c
@@ -653,7 +653,10 @@ void intercept_sendpkt(const char *legend,
 		  struct pkt *pkt, int len)
 {
     char pkt_dump[BUFSIZ], newpacket[BUFSIZ];
-
+if (1) {
+	sendpkt(dest, ep, ttl, pkt, len);
+	return;
+};
     packet_dump(pkt_dump, sizeof(pkt_dump), dest, pkt, len);
     snprintf(newpacket, sizeof(newpacket), "sendpkt %s %s\n", legend, pkt_dump);
 
@@ -676,6 +679,10 @@ void intercept_sendpkt(const char *legend,
 void intercept_receive(struct recvbuf *rbufp)
 {
     char pkt_dump[BUFSIZ], newpacket[BUFSIZ];
+if (1) {
+	receive(rbufp);
+	return;
+};
 
     packet_dump(pkt_dump, sizeof(pkt_dump),
 		&rbufp->recv_srcadr,


=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -2240,19 +2240,7 @@ peer_clear(
 	} else if (MODE_PASSIVE == peer->hmode) {
 		peer->nextdate += ntp_minpkt;
 	} else {
-	    /*
-	     * Randomizing the next poll interval used to be done with
-	     * ntp_random(); this leads to replay-mode problems and is
-	     * unnecessary, any deterministic but uniformly
-	     * distributed function of the peer state would be good
-	     * enough.  Furthermore, changing the function creates no
-	     * interop problems. For security reasons (to prevent
-	     * hypothetical timing attacks) we want at least one input
-	     * to be invisible from outside ntpd; the internal
-	     * association ID fits the bill.
-	     */
-	    int pseudorandom = peer->associd ^ sock_hash(&peer->srcadr);
-	    peer->nextdate += pseudorandom % peer->minpoll;
+		peer->nextdate += intercept_ntp_random(__func__) % peer->minpoll;
 	}
 #ifdef ENABLE_AUTOKEY
 	peer->refresh = current_time + (1 << NTP_REFRESH);


=====================================
ntpd/ntpd.c
=====================================
--- a/ntpd/ntpd.c
+++ b/ntpd/ntpd.c
@@ -622,17 +622,6 @@ ntpdmain(
 			"must be run as root, not uid %ld", (long)uid);
 		exit(1);
 	}
-	switch (intercept_get_mode())
-	{
-	case none:
-	    break;
-	case replay:
-	    msyslog(LOG_NOTICE, "setting replay mode.");
-	    break;
-	case capture:
-	    msyslog(LOG_NOTICE, "setting capture mode.");
-	    break;
-	}
 
 # ifdef HAVE_WORKING_FORK
 	if (wait_sync <= 0)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/92d3680806f8fb226ec91db4d846f816631206ad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20151215/29b5412a/attachment.html>


More information about the vc mailing list