[Git][NTPsec/ntpsec][master] 2 commits: Remove unused cruft from peer structure - was for asymmetry corrections??

Hal Murray gitlab at mg.gitlab.com
Fri Jul 6 06:33:26 UTC 2018


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
4fa0e409 by Hal Murray at 2018-07-06T05:57:13Z
Remove unused cruft from peer structure - was for asymmetry corrections??

- - - - -
d3b93d7d by Hal Murray at 2018-07-06T06:04:54Z
Remove RES_ALLFLAGS, update MAC_LEN comments

- - - - -


3 changed files:

- include/ntp.h
- ntpd/ntp_control.c
- ntpd/ntp_proto.c


Changes:

=====================================
include/ntp.h
=====================================
--- a/include/ntp.h
+++ b/include/ntp.h
@@ -285,17 +285,6 @@ struct peer {
 	double	disp;		/* peer dispersion */
 
 	/*
-	 * Variables used to correct for packet length and asymmetry.
-	 */
-	double	t21;		/* outbound packet delay */
-	int	t21_bytes;	/* outbound packet length */
-	int	t21_last;	/* last outbound packet length */
-	double	r21;		/* outbound data rate */
-	double	t34;		/* inbound packet delay */
-	int	t34_bytes;	/* inbound packet length */
-	double	r34;		/* inbound data rate */
-
-	/*
 	 * End of clear-to-zero area
 	 */
 	unsigned int   outcount;       /* packets sent without reply */
@@ -435,9 +424,13 @@ struct pkt {
 	l_fp_w	rec;		/* receive time stamp */
 	l_fp_w	xmt;		/* transmit time stamp */
 
+/* Old style authentication was just appended
+ * without the type/length of an extension header. */
+/* Length includes 1 word of keyID */
+/* MD5 length is 16 bytes => 4+1 */
+/* SHA length is 20 bytes => 5+1 */
 #define MIN_MAC_LEN	(1 * sizeof(uint32_t))	/* crypto_NAK */
-#define MAX_MD5_LEN	(5 * sizeof(uint32_t))	/* MD5 */
-#define	MAX_MAC_LEN	(6 * sizeof(uint32_t))	/* SHA */
+#define	MAX_MAC_LEN	(6 * sizeof(uint32_t))	/* MAX of old style */
 
 	uint32_t	exten[(MAX_MAC_LEN) / sizeof(uint32_t)];
 } __attribute__ ((aligned));
@@ -689,11 +682,6 @@ struct restrict_u_tag {
 #define	RES_FLAKE		0x1000	/* flakeway - drop 10% */
 #define	RES_NOMRULIST		0x2000	/* mode 6 mrulist denied */
 
-#define	RES_ALLFLAGS		(RES_FLAGS | RES_NOQUERY |	\
-				 RES_NOMODIFY | RES_KOD |	\
-				 RES_MSSNTP | RES_FLAKE |	\
-				 RES_NOMRULIST)
-
 /* pythonize-header: start ignoring */
 
 /*


=====================================
ntpd/ntp_control.c
=====================================
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -272,19 +272,17 @@ static const struct ctl_proc control_codes[] = {
 #define	CP_FLASH		35
 #define	CP_MODE			36
 #define	CP_VARLIST		37
-#define	CP_IN			38
-#define	CP_OUT			39
-#define	CP_RATE			40
-#define	CP_BIAS			41
-#define	CP_SRCHOST		42
-#define	CP_TIMEREC		43
-#define	CP_TIMEREACH		44
-#define	CP_BADAUTH		45
-#define	CP_BOGUSORG		46
-#define	CP_OLDPKT		47
-#define	CP_SELDISP		48
-#define	CP_SELBROKEN		49
-#define	CP_CANDIDATE		50
+#define	CP_RATE			38
+#define	CP_BIAS			39
+#define	CP_SRCHOST		40
+#define	CP_TIMEREC		41
+#define	CP_TIMEREACH		42
+#define	CP_BADAUTH		43
+#define	CP_BOGUSORG		44
+#define	CP_OLDPKT		45
+#define	CP_SELDISP		46
+#define	CP_SELBROKEN		47
+#define	CP_CANDIDATE		48
 #define	CP_MAXCODE		CP_CANDIDATE
 
 /*
@@ -500,20 +498,18 @@ static const struct ctl_var peer_var[] = {
 	{ CP_FLASH,	RO, "flash" },		/* 35 */
 	{ CP_MODE,	RO, "mode" },		/* 36 */
 	{ CP_VARLIST,	RO, "peer_var_list" },	/* 37 */
-	{ CP_IN,	RO, "in" },		/* 38 */
-	{ CP_OUT,	RO, "out" },		/* 39 */
-	{ CP_RATE,	RO, "headway" },	/* 40 */
-	{ CP_BIAS,	RO, "bias" },		/* 41 */
-	{ CP_SRCHOST,	RO, "srchost" },	/* 42 */
-	{ CP_TIMEREC,	RO, "timerec" },	/* 43 */
-	{ CP_TIMEREACH,	RO, "timereach" },	/* 44 */
-	{ CP_BADAUTH,	RO, "badauth" },	/* 45 */
-	{ CP_BOGUSORG,	RO, "bogusorg" },	/* 46 */
-	{ CP_OLDPKT,	RO, "oldpkt" },		/* 47 */
-	{ CP_SELDISP,	RO, "seldisp" },	/* 48 */
-	{ CP_SELBROKEN,	RO, "selbroken" },	/* 49 */
-	{ CP_CANDIDATE, RO, "candidate" },	/* 50 */
-	{ 0,		EOV, "" }		/* 50/58 */
+	{ CP_RATE,	RO, "headway" },	/* 38 */
+	{ CP_BIAS,	RO, "bias" },		/* 39 */
+	{ CP_SRCHOST,	RO, "srchost" },	/* 40 */
+	{ CP_TIMEREC,	RO, "timerec" },	/* 41 */
+	{ CP_TIMEREACH,	RO, "timereach" },	/* 42 */
+	{ CP_BADAUTH,	RO, "badauth" },	/* 43 */
+	{ CP_BOGUSORG,	RO, "bogusorg" },	/* 44 */
+	{ CP_OLDPKT,	RO, "oldpkt" },		/* 45 */
+	{ CP_SELDISP,	RO, "seldisp" },	/* 46 */
+	{ CP_SELBROKEN,	RO, "selbroken" },	/* 47 */
+	{ CP_CANDIDATE, RO, "candidate" },	/* 48 */
+	{ 0,		EOV, "" }
 };
 
 
@@ -526,8 +522,6 @@ static const uint8_t def_peer_var[] = {
 	CP_SRCHOST,
 	CP_DSTADR,
 	CP_DSTPORT,
-	CP_OUT,
-	CP_IN,
 	CP_LEAP,
 	CP_STRATUM,
 	CP_PRECISION,
@@ -2131,16 +2125,6 @@ ctl_putpeer(
 				: 0);
 		break;
 
-	case CP_IN:
-		if (p->r21 > 0.)
-			ctl_putdbl(peer_var[id].text, p->r21 / MS_PER_S);
-		break;
-
-	case CP_OUT:
-		if (p->r34 > 0.)
-			ctl_putdbl(peer_var[id].text, p->r34 / MS_PER_S);
-		break;
-
 	case CP_RATE:
 		ctl_putuint(peer_var[id].text, p->throttle);
 		break;


=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -2089,7 +2089,6 @@ peer_xmit(
 		get_systime(&xmt_tx);
 		peer->org = xmt_tx;
 		xpkt.xmt = htonl_fp(xmt_tx);
-		peer->t21_bytes = (int)sendlen;
 		sendpkt(&peer->srcadr, peer->dstadr, &xpkt, (int)sendlen);
 		peer->sent++;
 		peer->outcount++;
@@ -2126,7 +2125,6 @@ peer_xmit(
 		msyslog(LOG_ERR, "PROTO: buffer overflow %zu", sendlen);
 		exit(1);
 	}
-	peer->t21_bytes = (int)sendlen;
 	sendpkt(&peer->srcadr, peer->dstadr, &xpkt, (int)sendlen);
 	peer->sent++;
         peer->outcount++;



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/3940674871efa1b09c86660b9261609bb79d019a...d3b93d7d29010d7706c748929e3a1086831830f0

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/3940674871efa1b09c86660b9261609bb79d019a...d3b93d7d29010d7706c748929e3a1086831830f0
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/20180706/fb77af6a/attachment.html>


More information about the vc mailing list