[Git][NTPsec/ntpsec][master] 3 commits: Fix typo

Hal Murray gitlab at mg.gitlab.com
Wed Feb 21 06:26:38 UTC 2018


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
b34dcd84 by Hal Murray at 2018-02-20T22:25:55-08:00
Fix typo

- - - - -
9d1dc5ed by Hal Murray at 2018-02-20T22:25:55-08:00
Reduce DNS logging in busy case

- - - - -
f953de33 by Hal Murray at 2018-02-20T22:25:55-08:00
Rename peer.cfg.ttl to peer.cfg.mode

Mode is only used by refclocks.  It used to be "overlaid" in
order to save a few bytes of storage.  ttl isn't used any more
so the name change just cleans things up.

ttl should be used by broadcase mode, but that fell through
the cracks somewhere.

- - - - -


17 changed files:

- include/ntp.h
- libntp/ntp_dns.c
- ntpd/ntp_config.c
- ntpd/ntp_control.c
- ntpd/ntp_parser.y
- ntpd/ntp_peer.c
- ntpd/ntp_proto.c
- ntpd/refclock_arbiter.c
- ntpd/refclock_generic.c
- ntpd/refclock_gpsd.c
- ntpd/refclock_hpgps.c
- ntpd/refclock_jjy.c
- ntpd/refclock_modem.c
- ntpd/refclock_nmea.c
- ntpd/refclock_shm.c
- ntpd/refclock_trimble.c
- pylib/util.py


Changes:

=====================================
include/ntp.h
=====================================
--- a/include/ntp.h
+++ b/include/ntp.h
@@ -159,12 +159,12 @@ typedef struct __endpt {
  */
 struct peer_ctl {
 	uint8_t		version;
-	unsigned int	flags;
 	uint8_t		minpoll;
 	uint8_t		maxpoll;
-	uint32_t	ttl;
+	uint32_t	flags;
 	keyid_t		peerkey;
 	double		bias;
+	uint32_t	mode;	/* only used by refclocks */
 #ifdef REFCLOCK
 	uint32_t	baud;
 	char		*path;
@@ -214,10 +214,11 @@ struct peer_ctl {
  * we are peering with. Most of this stuff is from section 3.2 of the
  * spec.
  *
- * The ttl field is overloaded; it's used in the refclock case to pass
- * in a mode byte that may contain a baud rate or subtype. Splitting
- * this field would complicate some call sequences that are already
- * unpleasantly intricate.
+ * The mode field is overloaded; it's used in the refclock case to pass
+ * in a mode word that may contain a baud rate or subtype as well as flags.
+ * Splitting this field would complicate some call sequences that are
+ * already unpleasantly intricate.
+ * It used to be called ttl which was used by multicast which we dropped.
  */
 struct peer {
 	struct peer *p_link;	/* link pointer in free & peer lists */


=====================================
libntp/ntp_dns.c
=====================================
--- a/libntp/ntp_dns.c
+++ b/libntp/ntp_dns.c
@@ -54,12 +54,19 @@ bool dns_probe(struct peer* pp)
         sigset_t        block_mask, saved_sig_mask;
 	const char	* busy = "";
 
+	/* Comment out the next two lines to get (much) more
+	 * printout when we are busy.
+	 */
+        if (NULL != active)
+		return false;
+
 	if (NULL != active)
 		busy = ", busy";
 	msyslog(LOG_INFO, "DNS: dns_probe: %s, cast_flags:%x, flags:%x%s",
-		pp->hostname, pp->cast_flags, (unsigned int)pp->cfg.flags, busy);
-        if (NULL != active)
+		pp->hostname, pp->cast_flags, pp->cfg.flags, busy);
+        if (NULL != active)	/* normally redundant */
 		return false;
+
 	active = pp;
 
         sigfillset(&block_mask);


=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -56,7 +56,6 @@
 /*
  * Selection algorithm tuning parameters
  */
-#define MAX_TTL		8	/* max ttl mapping vector size */
 
 /*
  * In the past, we told reference clocks from network peers by giving
@@ -681,17 +680,12 @@ create_peer_node(
 			break;
 
 		case T_Ttl:
-			if (option->value.u >= MAX_TTL) {
-				msyslog(LOG_ERR, "CONFIG: ttl: invalid argument");
-				errflag = true;
-			} else {
-				my_node->ctl.ttl = (uint8_t)option->value.u;
-			}
+			msyslog(LOG_ERR, "CONFIG: ttl, argument ignored");
 			break;
 
 		case T_Subtype:
 		case T_Mode:
-			my_node->ctl.ttl = option->value.u;
+			my_node->ctl.mode = option->value.u;
 			break;
 
 		case T_Key:
@@ -2658,7 +2652,7 @@ config_peers(
 	     client_ctl.minpoll = NTP_MINDPOLL;
 	     client_ctl.maxpoll = NTP_MAXPOLL_UNK;
 	     client_ctl.flags = FLAG_IBURST;
-	     client_ctl.ttl = 0;
+	     client_ctl.mode = 0;
 	     client_ctl.peerkey = 0;
 	     client_ctl.bias = 0;
 


=====================================
ntpd/ntp_control.c
=====================================
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -264,7 +264,7 @@ static const struct ctl_proc control_codes[] = {
 #define	CP_SENT			33
 #define	CP_FILTERROR		34
 #define	CP_FLASH		35
-#define	CP_TTL			36
+#define	CP_MODE			36
 #define	CP_VARLIST		37
 #define	CP_IN			38
 #define	CP_OUT			39
@@ -484,7 +484,7 @@ static const struct ctl_var peer_var[] = {
 	{ CP_SENT,	RO, "sent" },		/* 33 */
 	{ CP_FILTERROR,	RO, "filtdisp" },	/* 34 */
 	{ CP_FLASH,	RO, "flash" },		/* 35 */
-	{ CP_TTL,	RO, "ttl" },		/* 36 */
+	{ CP_MODE,	RO, "mode" },		/* 36 */
 	{ CP_VARLIST,	RO, "peer_var_list" },	/* 37 */
 	{ CP_IN,	RO, "in" },		/* 38 */
 	{ CP_OUT,	RO, "out" },		/* 39 */
@@ -531,7 +531,7 @@ static const uint8_t def_peer_var[] = {
 	CP_RATE,
 	CP_FLASH,
 	CP_KEYID,
-	CP_TTL,
+	CP_MODE,
 	CP_OFFSET,
 	CP_DELAY,
 	CP_DISPERSION,
@@ -2170,10 +2170,10 @@ ctl_putpeer(
 		ctl_puthex(peer_var[id].text, p->flash);
 		break;
 
-	case CP_TTL:
+	case CP_MODE:
 #ifdef REFCLOCK
 		if (p->cfg.flags & FLAG_REFCLOCK) {
-			ctl_putuint(peer_var[id].text, p->cfg.ttl);
+			ctl_putuint(peer_var[id].text, p->cfg.mode);
 			break;
 		}
 #endif


=====================================
ntpd/ntp_parser.y
=====================================
--- a/ntpd/ntp_parser.y
+++ b/ntpd/ntp_parser.y
@@ -424,7 +424,7 @@ option_int
 				$$ = create_attr_ival($1, $2);
 			} else {
 				$$ = NULL;
-				yyerror("fudge factor: stratum value out of boands, ignored");
+				yyerror("fudge factor: stratum value out of bounds, ignored");
 			}
 		}
 	;


=====================================
ntpd/ntp_peer.c
=====================================
--- a/ntpd/ntp_peer.c
+++ b/ntpd/ntp_peer.c
@@ -562,11 +562,11 @@ peer_refresh_interface(
 	niface = select_peerinterface(p, &p->srcadr, NULL);
 
 	DPRINT(4, (
-		   "peer_refresh_interface: %s->%s mode %d vers %d poll %d %d flags 0x%x 0x%x ttl %u key %08x: new interface: ",
+		   "peer_refresh_interface: %s->%s mode %d vers %d poll %d %d flags 0x%x 0x%x mode %u key %08x: new interface: ",
 		   p->dstadr == NULL ? "<null>" :
 		   socktoa(&p->dstadr->sin), socktoa(&p->srcadr), p->hmode,
 		   p->cfg.version, p->cfg.minpoll, p->cfg.maxpoll, p->cfg.flags, p->cast_flags,
-		   p->cfg.ttl, p->cfg.peerkey));
+		   p->cfg.mode, p->cfg.peerkey));
 	if (niface != NULL) {
 		DPRINT(4, (
 			   "fd=%d, bfd=%d, name=%.16s, flags=0x%x, ifindex=%u, sin=%s",
@@ -766,10 +766,10 @@ newpeer(
 
 	restrict_source(&peer->srcadr, false, 0);
 	mprintf_event(PEVNT_MOBIL, peer, "assoc %d", peer->associd);
-	DPRINT(1, ("newpeer: %s->%s mode %u vers %u poll %u %u flags 0x%x 0x%x ttl %u key %08x\n",
+	DPRINT(1, ("newpeer: %s->%s mode %u vers %u poll %u %u flags 0x%x 0x%x mode %u key %08x\n",
 		   latoa(peer->dstadr), socktoa(&peer->srcadr), peer->hmode,
 		   peer->cfg.version, peer->cfg.minpoll, peer->cfg.maxpoll, peer->cfg.flags,
-		   peer->cast_flags, peer->cfg.ttl, peer->cfg.peerkey));
+		   peer->cast_flags, peer->cfg.mode, peer->cfg.peerkey));
 	return peer;
 }
 


=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -746,7 +746,7 @@ handle_manycast(
 	mctl.flags = FLAG_PREEMPT | (FLAG_IBURST & mpeer->cfg.flags);
 	mctl.minpoll = mpeer->cfg.minpoll;
 	mctl.maxpoll = mpeer->cfg.maxpoll;
-	mctl.ttl = 0;
+	mctl.mode = 0;
 	mctl.peerkey = mpeer->cfg.peerkey;
 	newpeer(&rbufp->recv_srcadr, NULL, rbufp->dstadr,
 		MODE_CLIENT, &mctl, MDF_UCAST | MDF_UCLNT, false);
@@ -2498,7 +2498,7 @@ dns_take_pool(
 	pctl.minpoll = pool->cfg.minpoll;
 	pctl.maxpoll = pool->cfg.maxpoll;
 	pctl.flags = FLAG_PREEMPT | (FLAG_IBURST & pool->cfg.flags);
-	pctl.ttl = 0;
+	pctl.mode = 0;
 	pctl.peerkey = 0;
 	peer = newpeer(rmtadr, NULL, lcladr,
 		       MODE_CLIENT, &pctl, MDF_UCAST | MDF_UCLNT, false);


=====================================
ntpd/refclock_arbiter.c
=====================================
--- a/ntpd/refclock_arbiter.c
+++ b/ntpd/refclock_arbiter.c
@@ -97,8 +97,8 @@
 #define MAXSTA		40		/* max length of status string */
 #define MAXPOS		80		/* max length of position string */
 
-#define COMMAND_HALT_BCAST ( (peer->cfg.ttl % 2) ? "O0" : "B0" )
-#define COMMAND_START_BCAST ( (peer->cfg.ttl % 2) ? "O5" : "B5" )
+#define COMMAND_HALT_BCAST ( (peer->cfg.mode % 2) ? "O0" : "B0" )
+#define COMMAND_START_BCAST ( (peer->cfg.mode % 2) ? "O5" : "B5" )
 
 /*
  * ARB unit control structure
@@ -181,14 +181,14 @@ arb_start(
 	pp->clockdesc = DESCRIPTION;
 	memcpy((char *)&pp->refid, REFID, REFIDLEN);
 	peer->sstclktype = CTL_SST_TS_UHF;
-	if (peer->cfg.ttl > 1) {
-		msyslog(LOG_NOTICE, "REFCLOCK ARBITER: Invalid mode %u", peer->cfg.ttl);
+	if (peer->cfg.mode > 1) {
+		msyslog(LOG_NOTICE, "REFCLOCK ARBITER: Invalid mode %u", peer->cfg.mode);
 		close(fd);
 		pp->io.fd = -1;
 		free(up);
 		return false;
 	}
-	DPRINT(1, ("arbiter: mode = %u.\n", peer->cfg.ttl));
+	DPRINT(1, ("arbiter: mode = %u.\n", peer->cfg.mode));
 	IGNORE(write(pp->io.fd, COMMAND_HALT_BCAST, 2));
 	return true;
 }


=====================================
ntpd/refclock_generic.c
=====================================
--- a/ntpd/refclock_generic.c
+++ b/ntpd/refclock_generic.c
@@ -1454,10 +1454,10 @@ static struct parse_clockinfo
 
 static int ncltypes = sizeof(parse_clockinfo) / sizeof(struct parse_clockinfo);
 
-#define CLK_REALTYPE(x) ((int)(((x)->cfg.ttl) & 0x7F))
+#define CLK_REALTYPE(x) ((int)(((x)->cfg.mode) & 0x7F))
 /* carefull, CLK_TYPE() in refclock_trimle.c is different */
 #define CLK_TYPE(x)	((CLK_REALTYPE(x) >= ncltypes) ? ~0 : CLK_REALTYPE(x))
-#define CLK_PPS(x)	(((x)->cfg.ttl) & 0x80)
+#define CLK_PPS(x)	(((x)->cfg.mode) & 0x80)
 
 /*
  * Other constant stuff
@@ -2524,7 +2524,7 @@ parse_start(
 	}
 
 #ifdef ENABLE_CLASSIC_MODE
-	peer->cfg.ttl = (peer->procptr->refclkunit & ~0x80) >> 2;
+	peer->cfg.mode = (peer->procptr->refclkunit & ~0x80) >> 2;
 	peer->procptr->refclkunit = peer->procptr->refclkunit & 0x03;
 #endif /* ENABLE_CLASSIC_MODE */
 


=====================================
ntpd/refclock_gpsd.c
=====================================
--- a/ntpd/refclock_gpsd.c
+++ b/ntpd/refclock_gpsd.c
@@ -559,7 +559,7 @@ gpsd_start(
 	LOGIF(CLOCKINFO,
 	      (LOG_NOTICE, "%s: startup, device is '%s'",
 	       refclock_name(peer), up->device));
-	up->mode = MODE_OP_MODE(peer->cfg.ttl);
+	up->mode = MODE_OP_MODE(peer->cfg.mode);
 	if (up->mode > MODE_OP_MAXVAL)
 		up->mode = 0;
 	if (unit >= 128)
@@ -783,9 +783,9 @@ gpsd_control(
 		up->pps_fudge = dtolfp(pp->fudgetime1);
 		up->ibt_fudge = dtolfp(pp->fudgetime2);
 
-		if (MODE_OP_MODE((uint32_t)up->mode ^ peer->cfg.ttl)) {
+		if (MODE_OP_MODE((uint32_t)up->mode ^ peer->cfg.mode)) {
 			leave_opmode(peer, up->mode);
-			up->mode = MODE_OP_MODE(peer->cfg.ttl);
+			up->mode = MODE_OP_MODE(peer->cfg.mode);
 			enter_opmode(peer, up->mode);
 		}
 	}


=====================================
ntpd/refclock_hpgps.c
=====================================
--- a/ntpd/refclock_hpgps.c
+++ b/ntpd/refclock_hpgps.c
@@ -162,8 +162,8 @@ hpgps_start(
 	snprintf(device, sizeof(device), DEVICE, unit);
 	ldisc = LDISC_CLK;
 	speed = SPEED232;
-	/* subtype parameter to server config line shares ttl slot */
-	if (1 == peer->cfg.ttl) {
+	/* subtype parameter to server config line shares mode slot */
+	if (1 == peer->cfg.mode) {
 		ldisc |= LDISC_7O1;
 		speed = SPEED232Z;
 	}


=====================================
ntpd/refclock_jjy.c
=====================================
--- a/ntpd/refclock_jjy.c
+++ b/ntpd/refclock_jjy.c
@@ -413,7 +413,7 @@ jjy_start ( int unit, struct peer *peer )
 	char	sDeviceName [ sizeof(DEVICE) + 10 ], sLog [ MAX_LOGTEXT ] ;
 
         DPRINT(1, ("refclock_jjy.c: jjy_start: %s  mode=%u  dev=%s  unit=%d\n",
-			 socktoa(&peer->srcadr), peer->cfg.ttl, DEVICE, unit )) ;
+			 socktoa(&peer->srcadr), peer->cfg.mode, DEVICE, unit )) ;
 
 	/* Allocate memory for the unit structure */
 	up = emalloc_zero( sizeof(*up) ) ;
@@ -436,13 +436,13 @@ jjy_start ( int unit, struct peer *peer )
 	snprintf( sDeviceName, sizeof(sDeviceName), DEVICE, unit ) ;
 
 	snprintf(sLog, sizeof(sLog), "subtype=%u dev=%s", 
-                 peer->cfg.ttl, sDeviceName ) ;
+                 peer->cfg.mode, sDeviceName ) ;
 	jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, sLog ) ;
 
 	/*
-	 * peer->cfg.ttl is a subtype number specified by "jjy subtype N" in the ntp.conf
+	 * peer->cfg.mode is a subtype number specified by "jjy subtype N" in the ntp.conf
 	 */
-	switch ( peer->cfg.ttl ) {
+	switch ( peer->cfg.mode ) {
 	case 0 :
 	case 1 :
 		rc = jjy_start_tristate_jjy01 ( unit, peer, up ) ;
@@ -466,12 +466,12 @@ jjy_start ( int unit, struct peer *peer )
 		rc = jjy_start_telephone ( unit, peer, up ) ;
 		break ;
 	default :
-		if ( 101 <= peer->cfg.ttl && peer->cfg.ttl <= 180 ) {
+		if ( 101 <= peer->cfg.mode && peer->cfg.mode <= 180 ) {
 			rc = jjy_start_telephone ( unit, peer, up ) ;
 		} else {
 		    msyslog (LOG_ERR, 
 			"JJY receiver [ %s subtype %u ] : Unsupported mode",
-			socktoa(&peer->srcadr), peer->cfg.ttl ) ;
+			socktoa(&peer->srcadr), peer->cfg.mode ) ;
 		    free ( (void*) up ) ;
 		    return false ;
 		}
@@ -480,7 +480,7 @@ jjy_start ( int unit, struct peer *peer )
 	if ( rc != 0 ) {
 		msyslog(LOG_ERR,
                         "REFCLOCK: JJY receiver [ %s subtype %u ] : Initialize error",
-			socktoa(&peer->srcadr), peer->cfg.ttl ) ;
+			socktoa(&peer->srcadr), peer->cfg.mode ) ;
 		free ( (void*) up ) ;
 		return false ;
 	}
@@ -3086,7 +3086,7 @@ teljjy_getDelay ( struct peer *peer, struct jjyunit *up )
 
 	/* subtype 101 = 1%, subtype 150 = 50%, subtype 180 = 80% */
 
-	iPercent = (int)peer->cfg.ttl - 100 ;
+	iPercent = (int)peer->cfg.mode - 100 ;
 
 	/* Average delay time in milli second */
 
@@ -3326,12 +3326,12 @@ teljjy_conn_send ( struct peer *peer, struct refclockproc *pp, struct jjyunit *u
 	  	return TELJJY_CHANGE_CLOCK_STATE ;
 	}
 
-	if ( up->iClockCommandSeq == 0 && peer->cfg.ttl == 100 ) {
+	if ( up->iClockCommandSeq == 0 && peer->cfg.mode == 100 ) {
 		/* Skip loopback */
 
 		up->iClockCommandSeq = TELJJY_COMMAND_START_SKIP_LOOPBACK ;
 
-	} else if ( up->iClockCommandSeq == 0 && peer->cfg.ttl != 100 ) {
+	} else if ( up->iClockCommandSeq == 0 && peer->cfg.mode != 100 ) {
 		/* Loopback start */
 
 		up->iLoopbackCount = 0 ;
@@ -3339,7 +3339,7 @@ teljjy_conn_send ( struct peer *peer, struct refclockproc *pp, struct jjyunit *u
 			up->bLoopbackTimeout[i] = false ;
 		}
 
-	} else if ( up->iClockCommandSeq > 0 && peer->cfg.ttl != 100
+	} else if ( up->iClockCommandSeq > 0 && peer->cfg.mode != 100
 		 && teljjy_command_sequence[up->iClockCommandSeq].iExpectedReplyType == TELJJY_REPLY_LOOPBACK
 		 && up->iLoopbackCount < MAX_LOOPBACK ) {
 		/* Loopback character comes */
@@ -3500,7 +3500,7 @@ teljjy_conn_data ( struct peer *peer, struct refclockproc *pp, struct jjyunit *u
 #endif
 			bAdjustment = true ;
 
-			if ( peer->cfg.ttl == 100 ) {
+			if ( peer->cfg.mode == 100 ) {
 				/* subtype=100 */
 				up->msecond = 0 ;
 			} else {
@@ -3520,7 +3520,7 @@ teljjy_conn_data ( struct peer *peer, struct refclockproc *pp, struct jjyunit *u
 
 				jjy_synctime( peer, pp, up ) ;
 
-				if ( peer->cfg.ttl != 100 ) {
+				if ( peer->cfg.mode != 100 ) {
 					if ( bAdjustment ) {
 						snprintf( sLog, sizeof(sLog),
 							  JJY_CLOCKSTATS_MESSAGE_DELAY_ADJUST,


=====================================
ntpd/refclock_modem.c
=====================================
--- a/ntpd/refclock_modem.c
+++ b/ntpd/refclock_modem.c
@@ -656,7 +656,7 @@ modem_poll(
 	 */
 	pp = peer->procptr;
 	up = pp->unitptr;
-	switch (peer->cfg.ttl) {
+	switch (peer->cfg.mode) {
 
 	/*
 	 * In manual mode the calling program is activated by the ntpq


=====================================
ntpd/refclock_nmea.c
=====================================
--- a/ntpd/refclock_nmea.c
+++ b/ntpd/refclock_nmea.c
@@ -393,7 +393,7 @@ nmea_start(
 
 
 	/* Old style: get baudrate choice from mode byte bits 4/5/6 */
-	rate = (peer->cfg.ttl & NMEA_BAUDRATE_MASK) >> NMEA_BAUDRATE_SHIFT;
+	rate = (peer->cfg.mode & NMEA_BAUDRATE_MASK) >> NMEA_BAUDRATE_SHIFT;
 
 	/* New style: get baudrate from baud option */
 	if (peer->cfg.baud)
@@ -883,7 +883,7 @@ nmea_receive(
 		return;	/* not something we know about */
 
 	/* Eventually output delay measurement now. */
-	if (peer->cfg.ttl & NMEA_DELAYMEAS_MASK) {
+	if (peer->cfg.mode & NMEA_DELAYMEAS_MASK) {
 		mprintf_clock_stats(peer, "delay %0.6f %.*s",
 			 ldexp(lfpfrac(rd_timestamp), -32),
 			 (int)(strchr(rd_lastcode, ',') - rd_lastcode),
@@ -891,8 +891,8 @@ nmea_receive(
 	}
 	
 	/* See if I want to process this message type */
-	if ((peer->cfg.ttl & NMEA_MESSAGE_MASK) &&
-	    !(peer->cfg.ttl & sentence_mode[sentence])) {
+	if ((peer->cfg.mode & NMEA_MESSAGE_MASK) &&
+	    !(peer->cfg.mode & sentence_mode[sentence])) {
 		up->tally.filtered++;
 		return;
 	}
@@ -1176,7 +1176,7 @@ nmea_poll(
 	 * clockstats file; otherwise just do a normal clock stats
 	 * record. Clear the tally stats anyway.
 	*/
-	if (peer->cfg.ttl & NMEA_EXTLOG_MASK) {
+	if (peer->cfg.mode & NMEA_EXTLOG_MASK) {
 		/* Log & reset counters with extended logging */
 		const char *nmea = pp->a_lastcode;
 		if (*nmea == '\0') nmea = "(none)";
@@ -1841,7 +1841,7 @@ eval_gps_time(
 
 	/* If we fully trust the GPS receiver, just combine days and
 	 * seconds and be done. */
-	if (peer->cfg.ttl & NMEA_DATETRUST_MASK) {
+	if (peer->cfg.mode & NMEA_DATETRUST_MASK) {
 		setlfpuint(retv, time64lo(ntpcal_dayjoin(gps_day, gps_sec)));
 		return retv;
 	}


=====================================
ntpd/refclock_shm.c
=====================================
--- a/ntpd/refclock_shm.c
+++ b/ntpd/refclock_shm.c
@@ -165,7 +165,7 @@ shm_start(
 	pp->io.datalen = 0;
 	pp->io.fd = -1;
 
-	up->forall = (unit >= 2) && !(peer->cfg.ttl & SHM_MODE_PRIVATE);
+	up->forall = (unit >= 2) && !(peer->cfg.mode & SHM_MODE_PRIVATE);
 
 	up->shm = getShmTime(unit, up->forall);
 


=====================================
ntpd/refclock_trimble.c
=====================================
--- a/ntpd/refclock_trimble.c
+++ b/ntpd/refclock_trimble.c
@@ -183,7 +183,7 @@ struct refclock refclock_trimble = {
 };
 
 /* Extract the clock type from the mode setting */
-#define CLK_TYPE(x) ((int)(((x)->cfg.ttl) & 0x7F))
+#define CLK_TYPE(x) ((int)(((x)->cfg.mode) & 0x7F))
 
 /* Supported clock types */
 #define CLK_PALISADE	0	/* Trimble Palisade */


=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -910,7 +910,7 @@ class PeerSummary:
         srchost = None
         srcport = 0
         stratum = 20
-        ttl = 0
+        mode = 0
         unreach = 0
         xmt = 0
 
@@ -1005,9 +1005,9 @@ class PeerSummary:
                 srcport = value
             elif name == "stratum":
                 stratum = value
-            elif name == "ttl":
-                # FIXME, ttl never used.
-                ttl = value
+            elif name == "mode":
+                # FIXME, mode never used.
+                mode = value
             elif name == "unreach":
                 # FIXME, unreach never used.
                 unreach = value



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/a74aeac32819a3cb0d7f68df261e90de1a3a883c...f953de33c9b6558deb14ed3173b75cfd490c2a06

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/a74aeac32819a3cb0d7f68df261e90de1a3a883c...f953de33c9b6558deb14ed3173b75cfd490c2a06
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/20180221/634d9a17/attachment.html>


More information about the vc mailing list