[Git][NTPsec/ntpsec][master] Restructure the peer block to keep the peerctl structure intact.

Eric S. Raymond gitlab at mg.gitlab.com
Thu Aug 31 15:29:34 UTC 2017


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


Commits:
f0a47d5e by Eric S. Raymond at 2017-08-31T11:16:14-04:00
Restructure the peer block to keep the peerctl structure intact.

Members that used to be copied ad hoc from the peer_ctl structure into
separate slots in a new peer structure are now, instead, copied into
a struct peer_ctl that retains their grouping.

This commit does no logic changes.  It is preparation for cleaning up the
logic in newpeer() that does the copies to do the block copy directly.
The ultimate goal is to eliminate friction when defining new struct peer_ctl
members in the configurator.

- - - - -


26 changed files:

- include/ntp.h
- libntp/ntp_dns.c
- ntpd/ntp_config.c
- ntpd/ntp_control.c
- ntpd/ntp_loopfilter.c
- ntpd/ntp_peer.c
- ntpd/ntp_proto.c
- ntpd/ntp_refclock.c
- ntpd/ntp_timer.c
- ntpd/ntpd.c
- ntpd/refclock_arbiter.c
- ntpd/refclock_generic.c
- ntpd/refclock_gpsd.c
- ntpd/refclock_hpgps.c
- ntpd/refclock_jjy.c
- ntpd/refclock_magnavox.c
- ntpd/refclock_modem.c
- ntpd/refclock_neoclock.c
- ntpd/refclock_nmea.c
- ntpd/refclock_oncore.c
- ntpd/refclock_pps.c
- ntpd/refclock_shm.c
- ntpd/refclock_spectracom.c
- ntpd/refclock_trimble.c
- ntpd/refclock_truetime.c
- ntpd/refclock_zyfer.c


Changes:

=====================================
include/ntp.h
=====================================
--- a/include/ntp.h
+++ b/include/ntp.h
@@ -224,29 +224,22 @@ struct peer {
 	struct peer *adr_link;	/* link pointer in address hash */
 	struct peer *aid_link;	/* link pointer in associd hash */
 	struct peer *ilink;	/* list of peers for interface */
+	struct peer_ctl cfg;	/* peer configuration block */
 	sockaddr_u srcadr;	/* address of remote host */
 	char *	hostname;	/* if non-NULL, remote name */
 	endpt *	dstadr;		/* local address */
 	associd_t associd;	/* association ID */
-	uint8_t	version;	/* version number */
 	uint8_t	hmode;		/* local association mode */
 	uint8_t	hpoll;		/* local poll interval */
-	uint8_t	minpoll;	/* min poll interval */
-	uint8_t	maxpoll;	/* max poll interval */
-	unsigned int	flags;	/* association flags */
 	uint8_t	cast_flags;	/* additional flags */
 	uint8_t	last_event;	/* last peer error code */
 	uint8_t	num_events;	/* number of error events */
-	uint32_t ttl;		/* time-to-live/refclock mode */
 
 	/*
 	 * Variables used by reference clock support
 	 */
 #ifdef REFCLOCK
 	struct refclockproc *procptr; /* refclock structure pointer */
-	char *  path;		/* override path if non-NULL */
-	char *  ppspath;	/* override PPS device path if non-NULL */
-	uint32_t baud;		/* baud rate to initialize driver with */
 	bool	is_pps_driver;	/* is this the PPS driver? */
 	uint8_t	refclkunit;	/* reference clock unit number */
 	uint8_t	sstclktype;	/* clock type for system status word */
@@ -265,10 +258,6 @@ struct peer {
 	uint32_t	refid;	/* remote reference ID */
 	l_fp	reftime;	/* update epoch */
 
-	/*
-	 * Variables used by authenticated client
-	 */
-	keyid_t keyid;		/* current key ID */
 #define clear_to_zero status
 
 	/*


=====================================
libntp/ntp_dns.c
=====================================
--- a/libntp/ntp_dns.c
+++ b/libntp/ntp_dns.c
@@ -58,7 +58,7 @@ bool dns_probe(struct peer* pp)
 	if (NULL != active)
 		busy = ", busy";
 	msyslog(LOG_INFO, "DNS: dns_probe: %s, cast_flags:%x, flags:%x%s",
-		pp->hostname, pp->cast_flags, pp->flags, busy);
+		pp->hostname, pp->cast_flags, (unsigned int)pp->cfg.flags, busy);
         if (NULL != active)
 		return false;
 	active = pp;
@@ -86,7 +86,7 @@ void dns_check(void)
 	DNS_Status status;
 
 	msyslog(LOG_INFO, "DNS: dns_check: processing %s, %x, %x",
-		active->hostname, active->cast_flags, active->flags);
+		active->hostname, active->cast_flags, (unsigned int)active->cfg.flags);
 
 	rc = pthread_join(worker, NULL);
 	if (0 != rc) {


=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -2738,13 +2738,13 @@ config_peers(
 			    /* default maxpoll for
 			     * refclocks is minpoll
 			     */
-			    peer->maxpoll = peer->minpoll;
+			    peer->cfg.maxpoll = peer->cfg.minpoll;
 		    clktype = (uint8_t)REFCLOCKTYPE(&peer->srcadr);
 		    unit = REFCLOCKUNIT(&peer->srcadr);
 
-		    peer->path = curr_peer->ctl.path;
-		    peer->ppspath = curr_peer->ctl.ppspath;
-		    peer->baud = curr_peer->ctl.baud;
+		    peer->cfg.path = curr_peer->ctl.path;
+		    peer->cfg.ppspath = curr_peer->ctl.ppspath;
+		    peer->cfg.baud = curr_peer->ctl.baud;
 		    if (refclock_newpeer(clktype,
 					  unit,
 					  peer))


=====================================
ntpd/ntp_control.c
=====================================
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -890,11 +890,11 @@ ctlpeerstatus(
 	unsigned short status;
 
 	status = p->status;
-	if (FLAG_CONFIG & p->flags)
+	if (FLAG_CONFIG & p->cfg.flags)
 		status |= CTL_PST_CONFIG;
-	if (p->keyid)
+	if (p->cfg.peerkey)
 		status |= CTL_PST_AUTHENABLE;
-	if (FLAG_AUTHENTIC & p->flags)
+	if (FLAG_AUTHENTIC & p->cfg.flags)
 		status |= CTL_PST_AUTHENTIC;
 	if (p->reach)
 		status |= CTL_PST_REACH;
@@ -2067,16 +2067,16 @@ ctl_putpeer(
 
 	case CP_CONFIG:
 		ctl_putuint(peer_var[id].text,
-			    !(FLAG_PREEMPT & p->flags));
+			    !(FLAG_PREEMPT & p->cfg.flags));
 		break;
 
 	case CP_AUTHENABLE:
-		ctl_putuint(peer_var[id].text, !(p->keyid));
+		ctl_putuint(peer_var[id].text, !(p->cfg.peerkey));
 		break;
 
 	case CP_AUTHENTIC:
 		ctl_putuint(peer_var[id].text,
-			    !!(FLAG_AUTHENTIC & p->flags));
+			    !!(FLAG_AUTHENTIC & p->cfg.flags));
 		break;
 
 	case CP_SRCADR:
@@ -2162,7 +2162,7 @@ ctl_putpeer(
 
 	case CP_REFID:
 #ifdef REFCLOCK
-		if (p->flags & FLAG_REFCLOCK) {
+		if (p->cfg.flags & FLAG_REFCLOCK) {
 			ctl_putrefid(peer_var[id].text, p->refid);
 			break;
 		}
@@ -2201,8 +2201,8 @@ ctl_putpeer(
 
 	case CP_TTL:
 #ifdef REFCLOCK
-		if (p->flags & FLAG_REFCLOCK) {
-			ctl_putuint(peer_var[id].text, p->ttl);
+		if (p->cfg.flags & FLAG_REFCLOCK) {
+			ctl_putuint(peer_var[id].text, p->cfg.ttl);
 			break;
 		}
 #endif
@@ -2234,10 +2234,10 @@ ctl_putpeer(
 		break;
 
 	case CP_KEYID:
-		if (p->keyid > NTP_MAXKEY)
-			ctl_puthex(peer_var[id].text, p->keyid);
+		if (p->cfg.peerkey > NTP_MAXKEY)
+			ctl_puthex(peer_var[id].text, p->cfg.peerkey);
 		else
-			ctl_putuint(peer_var[id].text, p->keyid);
+			ctl_putuint(peer_var[id].text, p->cfg.peerkey);
 		break;
 
 	case CP_FILTDELAY:
@@ -4042,16 +4042,16 @@ read_clockstatus(
 		 * is a clock use it, else search peer_list for one.
 		 */
 		if (sys_peer != NULL && (FLAG_REFCLOCK &
-		    sys_peer->flags))
+		    sys_peer->cfg.flags))
 			peer = sys_peer;
 		else
 			for (peer = peer_list;
 			     peer != NULL;
 			     peer = peer->p_link)
-				if (FLAG_REFCLOCK & peer->flags)
+				if (FLAG_REFCLOCK & peer->cfg.flags)
 					break;
 	}
-	if (NULL == peer || !(FLAG_REFCLOCK & peer->flags)) {
+	if (NULL == peer || !(FLAG_REFCLOCK & peer->cfg.flags)) {
 		ctl_error(CERR_BADASSOC);
 		return;
 	}


=====================================
ntpd/ntp_loopfilter.c
=====================================
--- a/ntpd/ntp_loopfilter.c
+++ b/ntpd/ntp_loopfilter.c
@@ -572,10 +572,10 @@ local_clock(
 	 * than 0.5 s or in ntpdate mode.
 	 */
 	osys_poll = sys_poll;
-	if (sys_poll < peer->minpoll)
-		sys_poll = peer->minpoll;
-	if (sys_poll > peer->maxpoll)
-		sys_poll = peer->maxpoll;
+	if (sys_poll < peer->cfg.minpoll)
+		sys_poll = peer->cfg.minpoll;
+	if (sys_poll > peer->cfg.maxpoll)
+		sys_poll = peer->cfg.maxpoll;
 	mu = current_time - clock_epoch;
 	clock_frequency = drift_comp;
 	rval = 1;
@@ -894,7 +894,7 @@ local_clock(
 		tc_counter += sys_poll;
 		if (tc_counter > CLOCK_LIMIT) {
 			tc_counter = CLOCK_LIMIT;
-			if (sys_poll < peer->maxpoll) {
+			if (sys_poll < peer->cfg.maxpoll) {
 				tc_counter = 0;
 				sys_poll++;
 			}
@@ -903,7 +903,7 @@ local_clock(
 		tc_counter -= sys_poll << 1;
 		if (tc_counter < -CLOCK_LIMIT) {
 			tc_counter = -CLOCK_LIMIT;
-			if (sys_poll > peer->minpoll) {
+			if (sys_poll > peer->cfg.minpoll) {
 				tc_counter = 0;
 				sys_poll--;
 			}


=====================================
ntpd/ntp_peer.c
=====================================
--- a/ntpd/ntp_peer.c
+++ b/ntpd/ntp_peer.c
@@ -381,7 +381,7 @@ score_all(
 	tamp = score(peer);
 	temp = 100;
 	for (speer = peer_list; speer != NULL; speer = speer->p_link)
-		if (speer->flags & FLAG_PREEMPT) {
+		if (speer->cfg.flags & FLAG_PREEMPT) {
 			x = score(speer);
 			if (x < temp)
 				temp = x;
@@ -441,7 +441,7 @@ free_peer(
 	int		hash;
 
 
-	if ((MDF_UCAST & p->cast_flags) && !(FLAG_DNS & p->flags)) {
+	if ((MDF_UCAST & p->cast_flags) && !(FLAG_DNS & p->cfg.flags)) {
 		hash = NTP_HASH_ADDR(&p->srcadr);
 		peer_hash_count[hash]--;
 
@@ -497,13 +497,13 @@ unpeer(
 	set_peerdstadr(peer, NULL);
 	peer_demobilizations++;
 	peer_associations--;
-	if (FLAG_PREEMPT & peer->flags)
+	if (FLAG_PREEMPT & peer->cfg.flags)
 		peer_preempt--;
 #ifdef REFCLOCK
 	/*
 	 * If this peer is actually a clock, shut it down first
 	 */
-	if (FLAG_REFCLOCK & peer->flags)
+	if (FLAG_REFCLOCK & peer->cfg.flags)
 		refclock_unpeer(peer);
 #endif
 
@@ -530,7 +530,7 @@ set_peerdstadr(
 	 * Don't accept updates to a separate multicast receive-only
 	 * endpt while a BCLNT peer is running its unicast protocol.
 	 */
-	if (dstadr != NULL && (FLAG_BC_VOL & p->flags) &&
+	if (dstadr != NULL && (FLAG_BC_VOL & p->cfg.flags) &&
 	    (INT_MCASTIF & dstadr->flags) && MODE_CLIENT == p->hmode) {
 		return;
 	}
@@ -565,8 +565,8 @@ peer_refresh_interface(
 		   "peer_refresh_interface: %s->%s mode %d vers %d poll %d %d flags 0x%x 0x%x ttl %u key %08x: new interface: ",
 		   p->dstadr == NULL ? "<null>" :
 		   socktoa(&p->dstadr->sin), socktoa(&p->srcadr), p->hmode,
-		   p->version, p->minpoll, p->maxpoll, p->flags, p->cast_flags,
-		   p->ttl, p->keyid));
+		   p->version, p->minpoll, p->maxpoll, p->cfg.flags, p->cast_flags,
+		   p->cfg.ttl, p->keyid));
 	if (niface != NULL) {
 		DPRINT(4, (
 			   "fd=%d, bfd=%d, name=%.16s, flags=0x%x, ifindex=%u, sin=%s",
@@ -607,7 +607,7 @@ refresh_all_peerinterfaces(void)
 			continue;
 		if (MDF_POOL & p->cast_flags)
 			continue;	/* Pool slots don't get interfaces. */
-		if (FLAG_DNS & p->flags)
+		if (FLAG_DNS & p->cfg.flags)
 			continue;	/* Still doing DNS lookup. */
 		peer_refresh_interface(p);
 
@@ -699,8 +699,8 @@ newpeer(
 	if (hostname != NULL)
 		peer->hostname = estrdup(hostname);
 	peer->hmode = hmode;
-	peer->version = ctl->version;
-	peer->flags = ctl->flags;
+	peer->cfg.version = ctl->version;
+	peer->cfg.flags = ctl->flags;
 	peer->cast_flags = cast_flags;
 	set_peerdstadr(peer, 
 		       select_peerinterface(peer, srcadr, dstadr));
@@ -713,10 +713,10 @@ newpeer(
          * maxpoll is clamped not less than NTP_MINPOLL
          * minpoll is clamped not greater than maxpoll.
 	 */
-	peer->minpoll = min(ctl->minpoll, NTP_MAXPOLL);
-	peer->maxpoll = max(ctl->maxpoll, NTP_MINPOLL);
-	if (peer->minpoll > peer->maxpoll)
-		peer->minpoll = peer->maxpoll;
+	peer->cfg.minpoll = min(ctl->minpoll, NTP_MAXPOLL);
+	peer->cfg.maxpoll = max(ctl->maxpoll, NTP_MINPOLL);
+	if (peer->cfg.minpoll > peer->cfg.maxpoll)
+		peer->cfg.minpoll = peer->cfg.maxpoll;
 
 	if (peer->dstadr != NULL)
 		DPRINT(3, ("newpeer(%s): using fd %d and our addr %s\n",
@@ -732,10 +732,10 @@ newpeer(
 	if ((MDF_BCAST & cast_flags) && peer->dstadr != NULL)
 		enable_broadcast(peer->dstadr, srcadr);
 
-	peer->ttl = ctl->ttl;
-	peer->keyid = ctl->peerkey;
+	peer->cfg.ttl = ctl->ttl;
+	peer->cfg.peerkey = ctl->peerkey;
 	peer->precision = sys_precision;
-	peer->hpoll = peer->minpoll;
+	peer->hpoll = peer->cfg.minpoll;
 	if (cast_flags & MDF_POOL)
 		peer_clear(peer, "POOL", initializing1);
 	else if (cast_flags & MDF_BCAST)
@@ -766,8 +766,8 @@ newpeer(
 	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",
 		   latoa(peer->dstadr), socktoa(&peer->srcadr), peer->hmode,
-		   peer->version, peer->minpoll, peer->maxpoll, peer->flags,
-		   peer->cast_flags, peer->ttl, peer->keyid));
+		   peer->cfg.version, peer->cfg.minpoll, peer->cfg.maxpoll, peer->cfg.flags,
+		   peer->cast_flags, peer->cfg.ttl, peer->cfg.peerkey));
 	return peer;
 }
 


=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -441,7 +441,7 @@ i_require_authentication(
 	)
 {
         bool restrict_notrust = restrict_mask & RES_DONTTRUST;
-        bool peer_has_key = peer != NULL && peer->keyid != 0;
+        bool peer_has_key = peer != NULL && peer->cfg.peerkey != 0;
         bool wants_association =
             PKT_MODE(pkt->li_vn_mode) == MODE_BROADCAST ||
             (peer == NULL && PKT_MODE(pkt->li_vn_mode == MODE_ACTIVE));
@@ -593,9 +593,9 @@ handle_procpkt(
 		if(!memcmp(pkt->refid, "RATE", REFIDLEN)) {
 			peer->selbroken++;
 			report_event(PEVNT_RATE, peer, NULL);
-			if (peer->minpoll < 10) { peer->minpoll = 10; }
+			if (peer->cfg.minpoll < 10) { peer->cfg.minpoll = 10; }
 			peer->burst = peer->retry = 0;
-			peer->throttle = (NTP_SHIFT + 1) * (1 << peer->minpoll);
+			peer->throttle = (NTP_SHIFT + 1) * (1 << peer->cfg.minpoll);
 			poll_update(peer, 10);
 		}
 		return;
@@ -691,7 +691,7 @@ handle_procpkt(
 		peer->retry = 0;
 		if (peer->reach)
 			peer->burst = min(1 << (peer->hpoll -
-			    peer->minpoll), NTP_SHIFT) - 1;
+			    peer->cfg.minpoll), NTP_SHIFT) - 1;
 		else
 			peer->burst = NTP_IBURST - 1;
 		if (peer->burst > 0)
@@ -744,11 +744,11 @@ handle_manycast(
 
 	memset(&mctl, '\0', sizeof(struct peer_ctl));
 	mctl.version = PKT_VERSION(pkt->li_vn_mode);
-	mctl.flags = FLAG_PREEMPT | (FLAG_IBURST & mpeer->flags);
-	mctl.minpoll = mpeer->minpoll;
-	mctl.maxpoll = mpeer->maxpoll;
+	mctl.flags = FLAG_PREEMPT | (FLAG_IBURST & mpeer->cfg.flags);
+	mctl.minpoll = mpeer->cfg.minpoll;
+	mctl.maxpoll = mpeer->cfg.maxpoll;
 	mctl.ttl = 0;
-	mctl.peerkey = mpeer->keyid;
+	mctl.peerkey = mpeer->cfg.peerkey;
 	newpeer(&rbufp->recv_srcadr, NULL, rbufp->dstadr,
 		MODE_CLIENT, &mctl, MDF_UCAST | MDF_UCLNT, false);
 }
@@ -829,8 +829,8 @@ receive(
 			!pkt->keyid_present || is_crypto_nak(pkt) ||
 			/* If we require a specific key from this peer,
 			   check that it matches. */
-			(peer != NULL && peer->keyid != 0 &&
-			 peer->keyid != pkt->keyid) ||
+			(peer != NULL && peer->cfg.peerkey != 0 &&
+			 peer->cfg.peerkey != pkt->keyid) ||
 			/* Verify the MAC.
 			   TODO: rewrite authdecrypt() to give it a
 			   better name and a saner interface so we don't
@@ -936,7 +936,7 @@ transmit(
 	}
 
 	/* Does server need DNS lookup? */
-	if (peer->flags & FLAG_DNS) {
+	if (peer->cfg.flags & FLAG_DNS) {
 		peer->outdate = current_time;
 		dns_probe(peer);
 		/* FIXME-DNS - need proper backoff */
@@ -974,7 +974,7 @@ transmit(
 				peer_unfit(peer);
 				report_event(PEVNT_UNREACH, peer, NULL);
 			}
-			if ((peer->flags & FLAG_IBURST) &&
+			if ((peer->cfg.flags & FLAG_IBURST) &&
 			    peer->retry == 0)
 				peer->retry = NTP_RETRY;
 		} else {
@@ -987,9 +987,9 @@ transmit(
 			 * clock_select().
 			 */
 			hpoll = sys_poll;
-			if (!(peer->flags & FLAG_PREEMPT))
+			if (!(peer->cfg.flags & FLAG_PREEMPT))
 				peer->unreach = 0;
-			if ((peer->flags & FLAG_BURST) && peer->retry ==
+			if ((peer->cfg.flags & FLAG_BURST) && peer->retry ==
 			    0 && !peer_unfit(peer))
 				peer->retry = NTP_RETRY;
 		}
@@ -1005,13 +1005,13 @@ transmit(
 		if (peer->unreach >= NTP_UNREACH) {
 			hpoll++;
 			/* ephemeral: no FLAG_CONFIG nor FLAG_PREEMPT */
-			if (!(peer->flags & (FLAG_CONFIG | FLAG_PREEMPT))) {
+			if (!(peer->cfg.flags & (FLAG_CONFIG | FLAG_PREEMPT))) {
 				report_event(PEVNT_RESTART, peer, "timeout");
 				peer_clear(peer, "TIME", false);
 				unpeer(peer);
 				return;
 			}
-			if ((peer->flags & FLAG_PREEMPT) &&
+			if ((peer->cfg.flags & FLAG_PREEMPT) &&
 			    (peer_associations > sys_maxclock) &&
 			    score_all(peer)) {
 				report_event(PEVNT_RESTART, peer, "timeout");
@@ -1069,10 +1069,10 @@ clock_update(
 	 */
 	sys_peer = peer;
 	sys_epoch = peer->epoch;
-	if (sys_poll < peer->minpoll)
-		sys_poll = peer->minpoll;
-	if (sys_poll > peer->maxpoll)
-		sys_poll = peer->maxpoll;
+	if (sys_poll < peer->cfg.minpoll)
+		sys_poll = peer->cfg.minpoll;
+	if (sys_poll > peer->cfg.maxpoll)
+		sys_poll = peer->cfg.maxpoll;
 	poll_update(peer, sys_poll);
 	sys_stratum = min(peer->stratum + 1, STRATUM_UNSPEC);
 	if (peer->stratum == STRATUM_REFCLOCK ||
@@ -1239,7 +1239,7 @@ poll_update(
 	 *
 	 * Clamp the poll interval between minpoll and maxpoll.
 	 */
-	hpoll = max(min(peer->maxpoll, mpoll), peer->minpoll);
+	hpoll = max(min(peer->cfg.maxpoll, mpoll), peer->cfg.minpoll);
 
 	peer->hpoll = hpoll;
 
@@ -1261,12 +1261,12 @@ poll_update(
 	 * reference clock, otherwise 2 s.
 	 */
 	utemp = current_time + (unsigned long)max(peer->throttle - (NTP_SHIFT - 1) *
-	    (1 << peer->minpoll), ntp_minpkt);
+	    (1 << peer->cfg.minpoll), ntp_minpkt);
 	if (peer->burst > 0) {
 		if (peer->nextdate > current_time)
 			return;
 #ifdef REFCLOCK
-		else if (peer->flags & FLAG_REFCLOCK)
+		else if (peer->cfg.flags & FLAG_REFCLOCK)
 			peer->nextdate = current_time + RESP_DELAY;
 #endif /* REFCLOCK */
 		else
@@ -1282,13 +1282,13 @@ poll_update(
 	 */
 	} else {
 		if (peer->retry > 0)
-			hpoll = peer->minpoll;
+			hpoll = peer->cfg.minpoll;
 		else if (!(peer->reach))
 			hpoll = peer->hpoll;
 		else
 			hpoll = min(peer->ppoll, peer->hpoll);
 #ifdef REFCLOCK
-		if (peer->flags & FLAG_REFCLOCK)
+		if (peer->cfg.flags & FLAG_REFCLOCK)
 			next = 1U << hpoll;
 		else
 #endif /* REFCLOCK */
@@ -1299,7 +1299,7 @@ poll_update(
 			peer->nextdate = next;
 		else
 			peer->nextdate = utemp;
-		if (peer->throttle > (1 << peer->minpoll))
+		if (peer->throttle > (1 << peer->cfg.minpoll))
 			peer->nextdate += (unsigned long)ntp_minpkt;
 	}
 	DPRINT(2, ("poll_update: at %lu %s poll %d burst %d retry %d head %d early %lu next %lu\n",
@@ -1327,8 +1327,8 @@ peer_clear(
 	 * Clear all values, including the optional crypto values above.
 	 */
 	memset(CLEAR_TO_ZERO(peer), 0, LEN_CLEAR_TO_ZERO(peer));
-	peer->ppoll = peer->maxpoll;
-	peer->hpoll = peer->minpoll;
+	peer->ppoll = peer->cfg.maxpoll;
+	peer->hpoll = peer->cfg.minpoll;
 	peer->disp = sys_maxdisp;
 	peer->flash = peer_unfit(peer);
 	peer->jitter = LOGTOD(sys_precision);
@@ -1338,7 +1338,7 @@ peer_clear(
 		peer->filter_disp[u] = sys_maxdisp;
 	}
 #ifdef REFCLOCK
-	if (!(peer->flags & FLAG_REFCLOCK)) {
+	if (!(peer->cfg.flags & FLAG_REFCLOCK)) {
 #endif
 		peer->leap = LEAP_NOTINSYNC;
 		peer->stratum = STRATUM_UNSPEC;
@@ -1372,7 +1372,7 @@ peer_clear(
 	     * association ID fits the bill.
 	     */
 	    int pseudorandom = peer->associd ^ sock_hash(&peer->srcadr);
-	    peer->nextdate += (unsigned long)(pseudorandom % (1 << peer->minpoll));
+	    peer->nextdate += (unsigned long)(pseudorandom % (1 << peer->cfg.minpoll));
 	}
 	DPRINT(1, ("peer_clear: at %lu next %lu associd %d refid %s\n",
 		   current_time, peer->nextdate, peer->associd,
@@ -1691,7 +1691,7 @@ clock_select(void)
 		 * This is an attempt to set up fallbacks in case falseticker
 		 * elimination leaves no survivors with better service quality.
 		 */
-		if (!(peer->flags & FLAG_PREFER)) {
+		if (!(peer->cfg.flags & FLAG_PREFER)) {
 		    if (peer->sstclktype == CTL_SST_TS_LOCAL) {
 			if (current_time > orphwait && typelocal == NULL)
 				typelocal = peer;
@@ -1828,7 +1828,7 @@ clock_select(void)
 		peer = peers[i].peer;
 		h = peers[i].synch;
 		if ((high <= low || peer->offset + h < low ||
-		    peer->offset - h > high) && !(peer->flags & FLAG_TRUE))
+		    peer->offset - h > high) && !(peer->cfg.flags & FLAG_TRUE))
 			continue;
 
 #ifdef REFCLOCK
@@ -1837,10 +1837,10 @@ clock_select(void)
 		 * algorithm. Use the first one found, but don't
 		 * include any of them in the cluster population.
 		 */
-		if (peer->flags & FLAG_PPS) {
+		if (peer->cfg.flags & FLAG_PPS) {
 			if (typepps == NULL)
 				typepps = peer;
-			if (!(peer->flags & FLAG_TSTAMP_PPS))
+			if (!(peer->cfg.flags & FLAG_TSTAMP_PPS))
 				continue;
 		}
 #endif /* REFCLOCK */
@@ -1915,7 +1915,7 @@ clock_select(void)
 			}
 		}
 		if (nlist <= max(1, sys_minclock) || g <= d ||
-		    ((FLAG_TRUE | FLAG_PREFER) & peers[k].peer->flags))
+		    ((FLAG_TRUE | FLAG_PREFER) & peers[k].peer->cfg.flags))
 			break;
 
 		DPRINT(3, ("select: drop %s seljit %.6f jit %.6f\n",
@@ -1961,18 +1961,18 @@ clock_select(void)
 		peer->new_status = CTL_PST_SEL_SYNCCAND;
 		sys_survivors++;
 		if (peer->leap == LEAP_ADDSECOND) {
-			if (peer->flags & FLAG_REFCLOCK)
+			if (peer->cfg.flags & FLAG_REFCLOCK)
 				leap_vote_ins = nlist;
 			else if (leap_vote_ins < nlist)
 				leap_vote_ins++;
 		}
 		if (peer->leap == LEAP_DELSECOND) {
-			if (peer->flags & FLAG_REFCLOCK)
+			if (peer->cfg.flags & FLAG_REFCLOCK)
 				leap_vote_del = nlist;
 			else if (leap_vote_del < nlist)
 				leap_vote_del++;
 		}
-		if (peer->flags & FLAG_PREFER)
+		if (peer->cfg.flags & FLAG_PREFER)
 			sys_prefer = peer;
 		speermet = peers[i].seljit * peers[i].synch +
 		    peer->stratum * sys_mindisp;
@@ -2175,7 +2175,7 @@ peer_xmit(
 	if (!peer->dstadr)	/* drop peers without interface */
 		return;
 
-	xpkt.li_vn_mode = PKT_LI_VN_MODE(sys_leap, peer->version,
+	xpkt.li_vn_mode = PKT_LI_VN_MODE(sys_leap, peer->cfg.version,
 	    peer->hmode);
 	xpkt.stratum = STRATUM_TO_PKT(sys_stratum);
 	xpkt.ppoll = peer->hpoll;
@@ -2193,7 +2193,7 @@ peer_xmit(
 	 * packet is not authenticated.
 	 */
 	sendlen = LEN_PKT_NOMAC;
-	if (peer->keyid == 0) {
+	if (peer->cfg.peerkey == 0) {
 		/*
 		 * Transmit a-priori timestamps.  This is paired with
 		 * a later call used to record transmission time.
@@ -2205,7 +2205,7 @@ peer_xmit(
 		sendpkt(&peer->srcadr, peer->dstadr, &xpkt, (int)sendlen);
 		peer->sent++;
 		peer->outcount++;
-		peer->throttle += (1 << peer->minpoll) - 2;
+		peer->throttle += (1 << peer->cfg.minpoll) - 2;
 
 		DPRINT(1, ("transmit: at %lu %s->%s mode %d len %zu\n",
 			   current_time, peer->dstadr ?
@@ -2225,7 +2225,7 @@ peer_xmit(
 	get_systime(&xmt_tx);
 	peer->org = xmt_tx;
 	xpkt.xmt = htonl_fp(xmt_tx);
-	xkeyid = peer->keyid;
+	xkeyid = peer->cfg.peerkey;
 	authlen = (size_t)authencrypt(xkeyid, (uint32_t *)&xpkt, (int)sendlen);
 	if (authlen == 0) {
 		report_event(PEVNT_AUTH, peer, "no key");
@@ -2242,7 +2242,7 @@ peer_xmit(
 	sendpkt(&peer->srcadr, peer->dstadr, &xpkt, (int)sendlen);
 	peer->sent++;
         peer->outcount++;
-	peer->throttle += (1 << peer->minpoll) - 2;
+	peer->throttle += (1 << peer->cfg.minpoll) - 2;
 	DPRINT(1, ("transmit: at %lu %s->%s mode %d keyid %08x len %zu\n",
 		   current_time, peer->dstadr ?
 		   socktoa(&peer->dstadr->sin) : "-",
@@ -2422,7 +2422,7 @@ dns_take_server(
 	int		restrict_mask;
 	struct peer *	pp;
 
-	if(!(server->flags & FLAG_DNS))
+	if(!(server->cfg.flags & FLAG_DNS))
 		/* Already got an address for this slot. */
 		return;
 
@@ -2434,7 +2434,7 @@ dns_take_server(
 	}
 
 	msyslog(LOG_INFO, "PROTO: Server taking: %s", socktoa(rmtadr));
-	server->flags &= (unsigned)~FLAG_DNS;
+	server->cfg.flags &= (unsigned)~FLAG_DNS;
 		
 	server->srcadr = *rmtadr;
 	peer_update_hash(server);
@@ -2448,10 +2448,10 @@ dns_take_server(
 
 	peer_refresh_interface(server);
 
-	server->hpoll = server->minpoll;
+	server->hpoll = server->cfg.minpoll;
 	server->nextdate = current_time;
 	peer_xmit(server);
-	if (server->flags & FLAG_IBURST)
+	if (server->cfg.flags & FLAG_IBURST)
 	  server->retry = NTP_RETRY;
 	poll_update(server, server->hpoll);
 }
@@ -2481,16 +2481,16 @@ dns_take_pool(
 
 	lcladr = findinterface(rmtadr);
 	memset(&pctl, '\0', sizeof(struct peer_ctl));
-	pctl.version = pool->version;
-	pctl.minpoll = pool->minpoll;
-	pctl.maxpoll = pool->maxpoll;
-	pctl.flags = FLAG_PREEMPT | (FLAG_IBURST & pool->flags);
+	pctl.version = pool->cfg.version;
+	pctl.minpoll = pool->cfg.minpoll;
+	pctl.maxpoll = pool->cfg.maxpoll;
+	pctl.flags = FLAG_PREEMPT | (FLAG_IBURST & pool->cfg.flags);
 	pctl.ttl = 0;
 	pctl.peerkey = 0;
 	peer = newpeer(rmtadr, NULL, lcladr,
 		       MODE_CLIENT, &pctl, MDF_UCAST | MDF_UCLNT, false);
 	peer_xmit(peer);
-	if (peer->flags & FLAG_IBURST)
+	if (peer->cfg.flags & FLAG_IBURST)
 	  peer->retry = NTP_RETRY;
 	poll_update(peer, peer->hpoll);
 
@@ -2522,7 +2522,7 @@ void dns_take_status(struct peer* peer, DNS_Status status) {
 	switch (status) {
 		case DNS_good:
 			txt = "good";
-			if (FLAG_DNS & peer->flags)
+			if (FLAG_DNS & peer->cfg.flags)
 				/* server: got answer, but didn't like any */
 				/* (all) already in use ?? */
 				hpoll += 1;
@@ -2545,7 +2545,7 @@ void dns_take_status(struct peer* peer, DNS_Status status) {
 	if (hpoll > 12)
 		hpoll = 12;  /* 4096, a bit over an hour */
 	if ((DNS_good == status) &&
-		(MDF_UCAST & peer->cast_flags) && !(FLAG_DNS & peer->flags))
+		(MDF_UCAST & peer->cast_flags) && !(FLAG_DNS & peer->cfg.flags))
 		hpoll = 0;  /* server: no more */
 	msyslog(LOG_INFO, "PROTO: dns_take_status: %s=>%s, %d",
 		peer->hostname, txt, hpoll);
@@ -2610,14 +2610,14 @@ peer_unfit(
 	 * distance is greater than or equal to the distance threshold
 	 * plus the increment due to one host poll interval.
 	 */
-	if (!(peer->flags & FLAG_REFCLOCK) && root_distance(peer) >=
+	if (!(peer->cfg.flags & FLAG_REFCLOCK) && root_distance(peer) >=
 	    sys_maxdist + clock_phi * ULOGTOD(peer->hpoll))
 		rval |= BOGON11;		/* distance exceeded */
 /* Startup bug, https://gitlab.com/NTPsec/ntpsec/issues/68
  *   introduced with ntp-dev-4.2.7p385
  * [2085] Fix root distance and root dispersion calculations.
  */
-	if (!(peer->flags & FLAG_REFCLOCK) && peer->disp >=
+	if (!(peer->cfg.flags & FLAG_REFCLOCK) && peer->disp >=
 	    sys_maxdist + clock_phi * ULOGTOD(peer->hpoll))
 		rval |= BOGON11;		/* Initialization */
 
@@ -2634,7 +2634,7 @@ peer_unfit(
 	 * An unreachable error occurs if the server is unreachable or
 	 * the noselect bit is set.
 	 */
-	if (!peer->reach || (peer->flags & FLAG_NOSELECT))
+	if (!peer->reach || (peer->cfg.flags & FLAG_NOSELECT))
 		rval |= BOGON13;		/* unreachable */
 
 	peer->flash &= ~PEER_BOGON_MASK;


=====================================
ntpd/ntp_refclock.c
=====================================
--- a/ntpd/ntp_refclock.c
+++ b/ntpd/ntp_refclock.c
@@ -195,10 +195,10 @@ refclock_newpeer(
 	 * Initialize structures
 	 */
 	peer->refclkunit = (uint8_t)unit;
-	peer->flags |= FLAG_REFCLOCK;
+	peer->cfg.flags |= FLAG_REFCLOCK;
 	peer->leap = LEAP_NOTINSYNC;
 	peer->stratum = STRATUM_REFCLOCK;
-	peer->ppoll = peer->maxpoll;
+	peer->ppoll = peer->cfg.maxpoll;
 	pp->conf = refclock_conf[clktype];
 	pp->timestarted = current_time;
 	pp->io.fd = -1;
@@ -318,7 +318,7 @@ refclock_transmit(
 				peer->timereachable = current_time;
 			}
 		} else {
-			if (peer->flags & FLAG_BURST)
+			if (peer->cfg.flags & FLAG_BURST)
 				peer->burst = NSTAGE;
 		}
 	} else {


=====================================
ntpd/ntp_timer.c
=====================================
--- a/ntpd/ntp_timer.c
+++ b/ntpd/ntp_timer.c
@@ -192,7 +192,7 @@ timer(void)
 #ifdef REFCLOCK
 		for (p = peer_list; p != NULL; p = next_peer) {
 			next_peer = p->p_link;
-			if (FLAG_REFCLOCK & p->flags)
+			if (FLAG_REFCLOCK & p->cfg.flags)
 				refclock_timer(p);
 		}
 #endif /* REFCLOCK */
@@ -216,7 +216,7 @@ timer(void)
 			p->throttle--;
 		if (p->nextdate <= current_time) {
 #ifdef REFCLOCK
-			if (FLAG_REFCLOCK & p->flags)
+			if (FLAG_REFCLOCK & p->cfg.flags)
 				refclock_transmit(p);
 			else
 #endif	/* REFCLOCK */


=====================================
ntpd/ntpd.c
=====================================
--- a/ntpd/ntpd.c
+++ b/ntpd/ntpd.c
@@ -1181,7 +1181,7 @@ static void check_minsane()
     if (sys_minsane > 1) return;  /* already adjusted, assume reasonable */
 
     for (peer = peer_list; peer != NULL; peer = peer->p_link) {
-	if (peer->flags & FLAG_NOSELECT) continue;
+	if (peer->cfg.flags & FLAG_NOSELECT) continue;
 	servers++;
 	if (peer->cast_flags & MDF_POOL) {
 	    /* pool server */


=====================================
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->ttl % 2) ? "O0" : "B0" )
-#define COMMAND_START_BCAST ( (peer->ttl % 2) ? "O5" : "B5" )
+#define COMMAND_HALT_BCAST ( (peer->cfg.ttl % 2) ? "O0" : "B0" )
+#define COMMAND_START_BCAST ( (peer->cfg.ttl % 2) ? "O5" : "B5" )
 
 /*
  * ARB unit control structure
@@ -151,8 +151,8 @@ arb_start(
 	 * Open serial port. Use CLK line discipline, if available.
 	 */
 	snprintf(device, sizeof(device), DEVICE, unit);
-	fd = refclock_open(peer->path ? peer->path : device,
-			   peer->baud ? peer->baud : SPEED232, LDISC_CLK);
+	fd = refclock_open(peer->cfg.path ? peer->cfg.path : device,
+			   peer->cfg.baud ? peer->cfg.baud : SPEED232, LDISC_CLK);
 	if (fd <= 0)
 		/* coverity[leaked_handle] */
 		return false;
@@ -182,14 +182,14 @@ arb_start(
 	pp->clockdesc = DESCRIPTION;
 	memcpy((char *)&pp->refid, REFID, REFIDLEN);
 	peer->sstclktype = CTL_SST_TS_UHF;
-	if (peer->ttl > 1) {
-		msyslog(LOG_NOTICE, "REFCLOCK ARBITER: Invalid mode %u", peer->ttl);
+	if (peer->cfg.ttl > 1) {
+		msyslog(LOG_NOTICE, "REFCLOCK ARBITER: Invalid mode %u", peer->cfg.ttl);
 		close(fd);
 		pp->io.fd = -1;
 		free(up);
 		return false;
 	}
-	DPRINT(1, ("arbiter: mode = %u.\n", peer->ttl));
+	DPRINT(1, ("arbiter: mode = %u.\n", peer->cfg.ttl));
 	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)->ttl) & 0x7F))
+#define CLK_REALTYPE(x) ((int)(((x)->cfg.ttl) & 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)->ttl) & 0x80)
+#define CLK_PPS(x)	(((x)->cfg.ttl) & 0x80)
 
 /*
  * Other constant stuff
@@ -2524,7 +2524,7 @@ parse_start(
 	}
 
 #ifdef ENABLE_CLASSIC_MODE
-	peer->ttl = (peer->refclkunit & ~0x80) >> 2;
+	peer->cfg.ttl = (peer->refclkunit & ~0x80) >> 2;
 	peer->refclkunit = peer->refclkunit & 0x03;
 #endif /* ENABLE_CLASSIC_MODE */
 
@@ -2545,7 +2545,7 @@ parse_start(
 	(void) snprintf(parsedev, sizeof(parsedev), PARSEDEVICE, unit);
 	(void) snprintf(parseppsdev, sizeof(parsedev), PARSEPPSDEVICE, unit);
 
-	fd232 = open(peer->path ? peer->path : parsedev,
+	fd232 = open(peer->cfg.path ? peer->cfg.path : parsedev,
 			 O_RDWR | O_NOCTTY | O_NONBLOCK, 0777);
 
 	if (fd232 == -1)
@@ -2949,7 +2949,7 @@ parse_poll(
 	parse->generic->polls++;
 
 	if (parse->pollneeddata &&
-	    ((int)(current_time - parse->pollneeddata) > (1<<(max(min(parse->peer->hpoll, parse->peer->ppoll), parse->peer->minpoll)))))
+	    ((int)(current_time - parse->pollneeddata) > (1<<(max(min(parse->peer->hpoll, parse->peer->ppoll), parse->peer->cfg.minpoll)))))
 	{
 		/*
 		 * start worrying when exceeding a poll interval
@@ -3685,13 +3685,13 @@ parse_process(
 		 */
 		if (PARSE_PPS(parsetime->parse_state) && CLK_PPS(parse->peer))
 			{
-				parse->peer->flags |= (FLAG_PPS | FLAG_TSTAMP_PPS);
+				parse->peer->cfg.flags |= (FLAG_PPS | FLAG_TSTAMP_PPS);
 				parse_hardpps(parse, PARSE_HARDPPS_ENABLE);
 			}
 #endif
 	} else {
 		parse_hardpps(parse, PARSE_HARDPPS_DISABLE);
-		parse->peer->flags &= ~(FLAG_PPS | FLAG_TSTAMP_PPS);
+		parse->peer->cfg.flags &= ~(FLAG_PPS | FLAG_TSTAMP_PPS);
 	}
 
 	/*


=====================================
ntpd/refclock_gpsd.c
=====================================
--- a/ntpd/refclock_gpsd.c
+++ b/ntpd/refclock_gpsd.c
@@ -508,9 +508,9 @@ gpsd_start(
 		 * practicable, we will have to read the symlink, if
 		 * any, so we can get the true device file.)
 		 */
-                if ( peer->path ) {
+                if ( peer->cfg.path ) {
                     /* use the ntp.conf path name */
-		    ret = myasprintf(&up->device, "%s", peer->path);
+		    ret = myasprintf(&up->device, "%s", peer->cfg.path);
                 } else {
                     ret = myasprintf(&up->device, DEVICE, up->unit);
                 }
@@ -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->ttl);
+	up->mode = MODE_OP_MODE(peer->cfg.ttl);
 	if (up->mode > MODE_OP_MAXVAL)
 		up->mode = 0;
 	if (unit >= 128)
@@ -740,7 +740,7 @@ poll_secondary(
 		refclock_receive(peer);
 	} else {
 		peer->precision = PPS_PRECISION;
-		peer->flags &= ~FLAG_PPS;
+		peer->cfg.flags &= ~FLAG_PPS;
 		refclock_report(peer, CEVNT_TIMEOUT);
 	}
 }
@@ -781,15 +781,15 @@ gpsd_control(
 	if (peer == up->pps_peer) {
 		up->pps_fudge2 = dtolfp(pp->fudgetime1);
 		if ( ! (pp->sloppyclockflag & CLK_FLAG1))
-			peer->flags &= ~FLAG_PPS;
+			peer->cfg.flags &= ~FLAG_PPS;
 	} else {
 		/* save preprocessed fudge times */
 		up->pps_fudge = dtolfp(pp->fudgetime1);
 		up->ibt_fudge = dtolfp(pp->fudgetime2);
 
-		if (MODE_OP_MODE((uint32_t)up->mode ^ peer->ttl)) {
+		if (MODE_OP_MODE((uint32_t)up->mode ^ peer->cfg.ttl)) {
 			leave_opmode(peer, up->mode);
-			up->mode = MODE_OP_MODE(peer->ttl);
+			up->mode = MODE_OP_MODE(peer->cfg.ttl);
 			enter_opmode(peer, up->mode);
 		}
 	}
@@ -865,7 +865,7 @@ timer_secondary(
 			refclock_report(peer, CEVNT_TIMEOUT);
 			pp->coderecv = pp->codeproc;
 		}
-		peer->flags &= ~FLAG_PPS;
+		peer->cfg.flags &= ~FLAG_PPS;
 	}
 }
 
@@ -985,7 +985,7 @@ eval_pps_secondary(
 		up->ppscount2 = min(PPS2_MAXCOUNT, (up->ppscount2 + 2));
 		if ((PPS2_MAXCOUNT == up->ppscount2) &&
 		    (pp->sloppyclockflag & CLK_FLAG1) )
-			peer->flags |= FLAG_PPS;
+			peer->cfg.flags |= FLAG_PPS;
 		/* mark time stamp as burned... */
 		up->fl_pps2 = 0;
 		++up->tc_pps_used;


=====================================
ntpd/refclock_hpgps.c
=====================================
--- a/ntpd/refclock_hpgps.c
+++ b/ntpd/refclock_hpgps.c
@@ -164,12 +164,12 @@ hpgps_start(
 	ldisc = LDISC_CLK;
 	speed = SPEED232;
 	/* subtype parameter to server config line shares ttl slot */
-	if (1 == peer->ttl) {
+	if (1 == peer->cfg.ttl) {
 		ldisc |= LDISC_7O1;
 		speed = SPEED232Z;
 	}
-	fd = refclock_open(peer->path ? peer->path : device,
-			   peer->baud ? peer->baud : speed, ldisc);
+	fd = refclock_open(peer->cfg.path ? peer->cfg.path : device,
+			   peer->cfg.baud ? peer->cfg.baud : speed, ldisc);
 	if (fd <= 0)
 		/* coverity[leaked_handle] */
 		return false;


=====================================
ntpd/refclock_jjy.c
=====================================
--- a/ntpd/refclock_jjy.c
+++ b/ntpd/refclock_jjy.c
@@ -417,7 +417,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->ttl, DEVICE, unit )) ;
+			 socktoa(&peer->srcadr), peer->cfg.ttl, DEVICE, unit )) ;
 
 	/* Allocate memory for the unit structure */
 	up = emalloc_zero( sizeof(*up) ) ;
@@ -440,13 +440,13 @@ jjy_start ( int unit, struct peer *peer )
 	snprintf( sDeviceName, sizeof(sDeviceName), DEVICE, unit ) ;
 
 	snprintf(sLog, sizeof(sLog), "subtype=%u dev=%s", 
-                 peer->ttl, sDeviceName ) ;
+                 peer->cfg.ttl, sDeviceName ) ;
 	jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, sLog ) ;
 
 	/*
-	 * peer->ttl is a subtype number specified by "jjy subtype N" in the ntp.conf
+	 * peer->cfg.ttl is a subtype number specified by "jjy subtype N" in the ntp.conf
 	 */
-	switch ( peer->ttl ) {
+	switch ( peer->cfg.ttl ) {
 	case 0 :
 	case 1 :
 		rc = jjy_start_tristate_jjy01 ( unit, peer, up ) ;
@@ -470,12 +470,12 @@ jjy_start ( int unit, struct peer *peer )
 		rc = jjy_start_telephone ( unit, peer, up ) ;
 		break ;
 	default :
-		if ( 101 <= peer->ttl && peer->ttl <= 180 ) {
+		if ( 101 <= peer->cfg.ttl && peer->cfg.ttl <= 180 ) {
 			rc = jjy_start_telephone ( unit, peer, up ) ;
 		} else {
 		    msyslog (LOG_ERR, 
 			"JJY receiver [ %s subtype %u ] : Unsupported mode",
-			socktoa(&peer->srcadr), peer->ttl ) ;
+			socktoa(&peer->srcadr), peer->cfg.ttl ) ;
 		    free ( (void*) up ) ;
 		    return false ;
 		}
@@ -484,7 +484,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->ttl ) ;
+			socktoa(&peer->srcadr), peer->cfg.ttl ) ;
 		free ( (void*) up ) ;
 		return false ;
 	}
@@ -521,7 +521,7 @@ jjy_start ( int unit, struct peer *peer )
 
 	peer->precision = PRECISION ;
 
-	snprintf( sLog, sizeof(sLog), "minpoll=%d maxpoll=%d", peer->minpoll, peer->maxpoll ) ;
+	snprintf( sLog, sizeof(sLog), "minpoll=%d maxpoll=%d", peer->cfg.minpoll, peer->cfg.maxpoll ) ;
 	jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, sLog ) ;
 
 	return true;
@@ -550,7 +550,7 @@ jjy_shutdown ( int unit, struct peer *peer )
 	}
 
 	snprintf(sLog, sizeof(sLog), "JJY stopped. unit=%d subtype=%u",
-                 unit, peer->ttl);
+                 unit, peer->cfg.ttl);
 	record_clock_stats(peer, sLog ) ;
 
 }
@@ -2786,17 +2786,17 @@ jjy_start_telephone ( int unit, struct peer *peer, struct jjyunit *up )
 	snprintf( sLog, sizeof(sLog), "phone=%s", sys_phone[0] ) ;
 	jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, sLog ) ;
 
-	if ( peer->minpoll < 8 ) {
+	if ( peer->cfg.minpoll < 8 ) {
 		/* minpoll must be greater or equal to 8 ( 256 seconds = about 4 minutes ) */
-		int oldminpoll = peer->minpoll ;
-		peer->minpoll = 8 ;
-		if ( peer->ppoll < peer->minpoll ) {
-			peer->ppoll = peer->minpoll ;
+		int oldminpoll = peer->cfg.minpoll ;
+		peer->cfg.minpoll = 8 ;
+		if ( peer->ppoll < peer->cfg.minpoll ) {
+			peer->ppoll = peer->cfg.minpoll ;
 		}
-		if ( peer->maxpoll < peer->minpoll ) {
-			peer->maxpoll = peer->minpoll ;
+		if ( peer->cfg.maxpoll < peer->cfg.minpoll ) {
+			peer->cfg.maxpoll = peer->cfg.minpoll ;
 		}
-		snprintf( sLog, sizeof(sLog), "minpoll=%d -> %d", oldminpoll, peer->minpoll ) ;
+		snprintf( sLog, sizeof(sLog), "minpoll=%d -> %d", oldminpoll, peer->cfg.minpoll ) ;
 		jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, sLog ) ;
 	}
 
@@ -3117,7 +3117,7 @@ teljjy_getDelay ( struct peer *peer, struct jjyunit *up )
 
 	/* subtype 101 = 1%, subtype 150 = 50%, subtype 180 = 80% */
 
-	iPercent = (int)peer->ttl - 100 ;
+	iPercent = (int)peer->cfg.ttl - 100 ;
 
 	/* Average delay time in milli second */
 
@@ -3357,12 +3357,12 @@ teljjy_conn_send ( struct peer *peer, struct refclockproc *pp, struct jjyunit *u
 	  	return TELJJY_CHANGE_CLOCK_STATE ;
 	}
 
-	if ( up->iClockCommandSeq == 0 && peer->ttl == 100 ) {
+	if ( up->iClockCommandSeq == 0 && peer->cfg.ttl == 100 ) {
 		/* Skip loopback */
 
 		up->iClockCommandSeq = TELJJY_COMMAND_START_SKIP_LOOPBACK ;
 
-	} else if ( up->iClockCommandSeq == 0 && peer->ttl != 100 ) {
+	} else if ( up->iClockCommandSeq == 0 && peer->cfg.ttl != 100 ) {
 		/* Loopback start */
 
 		up->iLoopbackCount = 0 ;
@@ -3370,7 +3370,7 @@ teljjy_conn_send ( struct peer *peer, struct refclockproc *pp, struct jjyunit *u
 			up->bLoopbackTimeout[i] = false ;
 		}
 
-	} else if ( up->iClockCommandSeq > 0 && peer->ttl != 100
+	} else if ( up->iClockCommandSeq > 0 && peer->cfg.ttl != 100
 		 && teljjy_command_sequence[up->iClockCommandSeq].iExpectedReplyType == TELJJY_REPLY_LOOPBACK
 		 && up->iLoopbackCount < MAX_LOOPBACK ) {
 		/* Loopback character comes */
@@ -3531,7 +3531,7 @@ teljjy_conn_data ( struct peer *peer, struct refclockproc *pp, struct jjyunit *u
 #endif
 			bAdjustment = true ;
 
-			if ( peer->ttl == 100 ) {
+			if ( peer->cfg.ttl == 100 ) {
 				/* subtype=100 */
 				up->msecond = 0 ;
 			} else {
@@ -3551,7 +3551,7 @@ teljjy_conn_data ( struct peer *peer, struct refclockproc *pp, struct jjyunit *u
 
 				jjy_synctime( peer, pp, up ) ;
 
-				if ( peer->ttl != 100 ) {
+				if ( peer->cfg.ttl != 100 ) {
 					if ( bAdjustment ) {
 						snprintf( sLog, sizeof(sLog),
 							  JJY_CLOCKSTATS_MESSAGE_DELAY_ADJUST,


=====================================
ntpd/refclock_magnavox.c
=====================================
--- a/ntpd/refclock_magnavox.c
+++ b/ntpd/refclock_magnavox.c
@@ -183,8 +183,8 @@ mx4200_start(
 	 * Open serial port
 	 */
 	snprintf(gpsdev, sizeof(gpsdev), DEVICE, unit);
-	fd = refclock_open(peer->path ? peer->path : gpsdev,
-			   peer->baud ? peer->baud : SPEED232,
+	fd = refclock_open(peer->cfg.path ? peer->cfg.path : gpsdev,
+			   peer->cfg.baud ? peer->cfg.baud : SPEED232,
 			   LDISC_PPS);
 	if (fd < 0)
 		return false;


=====================================
ntpd/refclock_modem.c
=====================================
--- a/ntpd/refclock_modem.c
+++ b/ntpd/refclock_modem.c
@@ -521,8 +521,8 @@ modem_timeout(
 		 * Open the device in raw mode and link the I/O.
 		 */
 		snprintf(device, sizeof(device), DEVICE, up->unit);
-		fd = refclock_open(peer->path ? peer->path : device,
-				   peer->baud ? peer->baud : SPEED232,
+		fd = refclock_open(peer->cfg.path ? peer->cfg.path : device,
+				   peer->cfg.baud ? peer->cfg.baud : SPEED232,
 				   LDISC_ACTS | LDISC_RAW | LDISC_REMOTE);
 		if (fd < 0) {
 			msyslog(LOG_ERR, "REFCLOCK: modem: open fails %m");
@@ -666,7 +666,7 @@ modem_poll(
 	 */
 	pp = peer->procptr;
 	up = pp->unitptr;
-	switch (peer->ttl) {
+	switch (peer->cfg.ttl) {
 
 	/*
 	 * In manual mode the calling program is activated by the ntpq


=====================================
ntpd/refclock_neoclock.c
=====================================
--- a/ntpd/refclock_neoclock.c
+++ b/ntpd/refclock_neoclock.c
@@ -146,8 +146,8 @@ neoclock4x_start(int unit,
   /* LDISC_STD, LDISC_RAW
    * Open serial port. Use CLK line discipline, if available.
    */
-  fd = refclock_open(peer->path ? peer->path : dev,
-		     peer->baud ? peer->baud : B2400,
+  fd = refclock_open(peer->cfg.path ? peer->cfg.path : dev,
+		     peer->cfg.baud ? peer->cfg.baud : B2400,
 		     LDISC_STD);
   if(fd <= 0)
     {


=====================================
ntpd/refclock_nmea.c
=====================================
--- a/ntpd/refclock_nmea.c
+++ b/ntpd/refclock_nmea.c
@@ -403,11 +403,11 @@ nmea_start(
 
 
 	/* Old style: get baudrate choice from mode byte bits 4/5/6 */
-	rate = (peer->ttl & NMEA_BAUDRATE_MASK) >> NMEA_BAUDRATE_SHIFT;
+	rate = (peer->cfg.ttl & NMEA_BAUDRATE_MASK) >> NMEA_BAUDRATE_SHIFT;
 
 	/* New style: get baudrate from baud option */
-	if (peer->baud)
-		rate = peer->baud;
+	if (peer->cfg.baud)
+		rate = peer->cfg.baud;
 
 	switch (rate) {
 	case 0:
@@ -478,7 +478,7 @@ nmea_start(
 
 	/* Open serial port. Use CLK line discipline, if available. */
 	snprintf(device, sizeof(device), DEVICE, unit);
-	pp->io.fd = refclock_open(peer->path ? peer->path : device,
+	pp->io.fd = refclock_open(peer->cfg.path ? peer->cfg.path : device,
 				  baudrate,
 				  LDISC_CLK);
 	if (-1 == pp->io.fd)
@@ -563,7 +563,7 @@ nmea_control(
                 /* FIXME: snprintf() can return negative on error */
 		devlen = (size_t)snprintf(device, sizeof(device), PPSDEV, unit);
 		if (devlen < sizeof(device)) {
-		    up->ppsapi_fd = open(peer->ppspath ? peer->ppspath : device,
+		    up->ppsapi_fd = open(peer->cfg.ppspath ? peer->cfg.ppspath : device,
 					 PPSOPENMODE, S_IRUSR | S_IWUSR);
 		} else {
 			up->ppsapi_fd = -1;
@@ -609,7 +609,7 @@ nmea_control(
 		up->ppsapi_lit   = false;
 		up->ppsapi_tried = false;
 
-		peer->flags &= ~FLAG_PPS;
+		peer->cfg.flags &= ~FLAG_PPS;
 		peer->precision = PRECISION;
 	}
 }
@@ -868,7 +868,7 @@ nmea_receive(
 		return;	/* not something we know about */
 
 	/* Eventually output delay measurement now. */
-	if (peer->ttl & NMEA_DELAYMEAS_MASK) {
+	if (peer->cfg.ttl & NMEA_DELAYMEAS_MASK) {
 		mprintf_clock_stats(peer, "delay %0.6f %.*s",
 			 ldexp(lfpfrac(rd_timestamp), -32),
 			 (int)(strchr(rd_lastcode, ',') - rd_lastcode),
@@ -876,8 +876,8 @@ nmea_receive(
 	}
 	
 	/* See if I want to process this message type */
-	if ((peer->ttl & NMEA_MESSAGE_MASK) &&
-	    !(peer->ttl & sentence_mode[sentence])) {
+	if ((peer->cfg.ttl & NMEA_MESSAGE_MASK) &&
+	    !(peer->cfg.ttl & sentence_mode[sentence])) {
 		up->tally.filtered++;
 		return;
 	}
@@ -1063,7 +1063,7 @@ nmea_receive(
 		case PPS_RELATE_PHASE:
 			up->ppsapi_gate = true;
 			peer->precision = PPS_PRECISION;
-			peer->flags |= FLAG_PPS;
+			peer->cfg.flags |= FLAG_PPS;
 			DPRINT(2, ("%s PPS_RELATE_PHASE\n",
 				   refclock_name(peer)));
 			up->tally.pps_used++;
@@ -1125,7 +1125,7 @@ nmea_poll(
 	 * for now.
 	 */
 	if (!up->ppsapi_gate) {
-		peer->flags &= ~FLAG_PPS;
+		peer->cfg.flags &= ~FLAG_PPS;
 		peer->precision = PRECISION;
 	} else {
 		up->ppsapi_gate = false;
@@ -1149,7 +1149,7 @@ nmea_poll(
 	 * clockstats file; otherwise just do a normal clock stats
 	 * record. Clear the tally stats anyway.
 	*/
-	if (peer->ttl & NMEA_EXTLOG_MASK) {
+	if (peer->cfg.ttl & NMEA_EXTLOG_MASK) {
 		/* Log & reset counters with extended logging */
 		const char *nmea = pp->a_lastcode;
 		if (*nmea == '\0') nmea = "(none)";
@@ -1813,7 +1813,7 @@ eval_gps_time(
 
 	/* If we fully trust the GPS receiver, just combine days and
 	 * seconds and be done. */
-	if (peer->ttl & NMEA_DATETRUST_MASK) {
+	if (peer->cfg.ttl & NMEA_DATETRUST_MASK) {
 		setlfpuint(retv, time64lo(ntpcal_dayjoin(gps_day, gps_sec)));
 		return retv;
 	}


=====================================
ntpd/refclock_oncore.c
=====================================
--- a/ntpd/refclock_oncore.c
+++ b/ntpd/refclock_oncore.c
@@ -616,10 +616,10 @@ oncore_start(
 	instance->Ag = 0xff;		/* Satellite mask angle, unset by user */
 	instance->ant_state = ONCORE_ANTENNA_UNKNOWN;
 
-	peer->flags &= ~FLAG_PPS;	/* PPS not active yet */
+	peer->cfg.flags &= ~FLAG_PPS;	/* PPS not active yet */
 	peer->precision = -26;
-	peer->minpoll = 4;
-	peer->maxpoll = 4;
+	peer->cfg.minpoll = 4;
+	peer->cfg.maxpoll = 4;
 	pp->clockname = NAME;
 	pp->clockdesc = DESCRIPTION;
 	memcpy((char *)&pp->refid, "GPS\0", (size_t) 4);
@@ -1610,14 +1610,14 @@ oncore_get_timestamp(
 
 	if ((instance->site_survey != ONCORE_SS_DONE) || (instance->mode != MODE_0D)) {
 #endif
-		peer->flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
+		peer->cfg.flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
 		return;
 	}
 
 	/* Don't do anything without an almanac to define the GPS->UTC delta */
 
 	if (instance->rsm.bad_almanac) {
-		peer->flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
+		peer->cfg.flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
 		return;
 	}
 
@@ -1629,7 +1629,7 @@ oncore_get_timestamp(
 
 	if (instance->count5) {
 		instance->count5--;
-		peer->flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
+		peer->cfg.flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
 		return;
 	}
 
@@ -1640,7 +1640,7 @@ oncore_get_timestamp(
 	    &timeout) < 0) {
 		oncore_log_f(instance, LOG_ERR,
 			     "time_pps_fetch failed %m");
-		peer->flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
+		peer->cfg.flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
 		return;
 	}
 
@@ -1661,7 +1661,7 @@ oncore_get_timestamp(
 
 		if (pps_i.assert_sequence == j) {
 			oncore_log(instance, LOG_NOTICE, "ONCORE: oncore_get_timestamp, error serial pps");
-			peer->flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
+			peer->cfg.flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
 			return;
 		}
 
@@ -1683,7 +1683,7 @@ oncore_get_timestamp(
 
 		if (pps_i.clear_sequence == j) {
 			oncore_log(instance, LOG_ERR, "oncore_get_timestamp, error serial pps");
-			peer->flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
+			peer->cfg.flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
 			return;
 		}
 		instance->ev_serial = pps_i.clear_sequence;
@@ -1723,14 +1723,14 @@ oncore_get_timestamp(
 	if (time_pps_getcap(instance->pps_h, &current_mode) < 0) {
 		oncore_log_f(instance, LOG_ERR,
 			     "time_pps_getcap failed: %m");
-		peer->flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
+		peer->cfg.flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
 		return;
 	}
 
 	if (time_pps_getparams(instance->pps_h, &current_params) < 0) {
 		oncore_log_f(instance, LOG_ERR,
 			     "time_pps_getparams failed: %m");
-		peer->flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
+		peer->cfg.flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
 		return;
 	}
 
@@ -1850,7 +1850,7 @@ oncore_get_timestamp(
 
 	if (!refclock_process(instance->pp)) {
 		refclock_report(instance->peer, CEVNT_BADTIME);
-		peer->flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
+		peer->cfg.flags &= ~FLAG_PPS;	/* problem - clear PPS FLAG */
 		return;
 	}
 
@@ -1863,7 +1863,7 @@ oncore_get_timestamp(
 		instance->pp->lastref = instance->pp->lastrec;
 		refclock_receive(instance->peer);
 	}
-	peer->flags |= FLAG_PPS;
+	peer->cfg.flags |= FLAG_PPS;
 }
 
 


=====================================
ntpd/refclock_pps.c
=====================================
--- a/ntpd/refclock_pps.c
+++ b/ntpd/refclock_pps.c
@@ -142,7 +142,7 @@ pps_start(
 	 * not necessarily the port used for the associated radio.
 	 */
 	snprintf(device, sizeof(device), DEVICE, unit);
-	up->fddev = open(peer->ppspath ? peer->ppspath : device,
+	up->fddev = open(peer->cfg.ppspath ? peer->cfg.ppspath : device,
 			     O_RDWR, 0777);
 	if (up->fddev <= 0) {
 		msyslog(LOG_ERR,
@@ -213,7 +213,7 @@ pps_timer(
         }
         if (rc != PPS_OK) return;
 
-	peer->flags |= FLAG_PPS;
+	peer->cfg.flags |= FLAG_PPS;
 
 	/*
 	 * If flag4 is lit, record each second offset to clockstats.
@@ -261,7 +261,7 @@ pps_poll(
 	up->pcount = up->scount = up->kcount = up->rcount = 0;
 
 	if (pp->codeproc == pp->coderecv) {
-		peer->flags &= ~FLAG_PPS;
+		peer->cfg.flags &= ~FLAG_PPS;
 		refclock_report(peer, CEVNT_TIMEOUT);
 		return;
 	}


=====================================
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->ttl & SHM_MODE_PRIVATE);
+	up->forall = (unit >= 2) && !(peer->cfg.ttl & SHM_MODE_PRIVATE);
 
 	up->shm = getShmTime(unit, up->forall);
 


=====================================
ntpd/refclock_spectracom.c
=====================================
--- a/ntpd/refclock_spectracom.c
+++ b/ntpd/refclock_spectracom.c
@@ -176,8 +176,8 @@ spectracom_start(
 	 * Open serial port. Use CLK line discipline, if available.
 	 */
 	snprintf(device, sizeof(device), DEVICE, unit);
-	fd = refclock_open(peer->path ? peer->path : device,
-			   peer->baud ? peer->baud : SPEED232,
+	fd = refclock_open(peer->cfg.path ? peer->cfg.path : device,
+			   peer->cfg.baud ? peer->cfg.baud : SPEED232,
 			   LDISC_CLK);
 	if (fd <= 0)
 		/* coverity[leaked_handle] */
@@ -426,7 +426,7 @@ spectracom_receive(
 	 */
 #ifdef HAVE_PPSAPI
 	up->tcount++;
-	if (peer->flags & FLAG_PPS)
+	if (peer->cfg.flags & FLAG_PPS)
 		return;
 
 #endif /* HAVE_PPSAPI */
@@ -477,7 +477,7 @@ spectracom_timer(
 	if (up->ppsapi_lit &&
 	    refclock_catcher(peer, &up->ppsctl, pp->sloppyclockflag) > 0) {
 		up->pcount++,
-		peer->flags |= FLAG_PPS;
+		peer->cfg.flags |= FLAG_PPS;
 		peer->precision = PPS_PRECISION;
 	}
 #endif /* HAVE_PPSAPI */
@@ -521,7 +521,7 @@ spectracom_poll(
 	 */
 #ifdef HAVE_PPSAPI
 	if (up->pcount == 0) {
-		peer->flags &= ~FLAG_PPS;
+		peer->cfg.flags &= ~FLAG_PPS;
 		peer->precision = PRECISION;
 	}
 	if (up->tcount == 0) {
@@ -571,7 +571,7 @@ spectracom_control(
 		up->ppsapi_tried = 0;
 		if (!up->ppsapi_lit)
 			return;
-		peer->flags &= ~FLAG_PPS;
+		peer->cfg.flags &= ~FLAG_PPS;
 		peer->precision = PRECISION;
 		time_pps_destroy(up->ppsctl.handle);
 		up->ppsctl.handle = 0;


=====================================
ntpd/refclock_trimble.c
=====================================
--- a/ntpd/refclock_trimble.c
+++ b/ntpd/refclock_trimble.c
@@ -209,7 +209,7 @@ struct refclock refclock_trimble = {
 };
 
 /* Extract the clock type from the mode setting */
-#define CLK_TYPE(x) ((int)(((x)->ttl) & 0x7F))
+#define CLK_TYPE(x) ((int)(((x)->cfg.ttl) & 0x7F))
 
 /* Supported clock types */
 #define CLK_TRIMBLE	0	/* Trimble Palisade */
@@ -378,8 +378,8 @@ trimble_start (
 	/*
 	 * Open serial port. 
 	 */
-	fd = refclock_open(peer->path ? peer->path : gpsdev,
-			   peer->baud ? peer->baud : SPEED232,
+	fd = refclock_open(peer->cfg.path ? peer->cfg.path : gpsdev,
+			   peer->cfg.baud ? peer->cfg.baud : SPEED232,
 			   LDISC_RAW);
 	if (fd <= 0) {
 #ifdef DEBUG
@@ -466,8 +466,8 @@ trimble_start (
 
 	peer->precision = PRECISION;
 	peer->sstclktype = CTL_SST_TS_UHF;
-	peer->minpoll = TRMB_MINPOLL;
-	peer->maxpoll = TRMB_MAXPOLL;
+	peer->cfg.minpoll = TRMB_MINPOLL;
+	peer->cfg.maxpoll = TRMB_MAXPOLL;
 	memcpy((char *)&pp->refid, REFID, REFIDLEN);
 	
 	up->leap_status = 0;


=====================================
ntpd/refclock_truetime.c
=====================================
--- a/ntpd/refclock_truetime.c
+++ b/ntpd/refclock_truetime.c
@@ -233,8 +233,8 @@ true_start(
 	 * Open serial port
 	 */
 	snprintf(device, sizeof(device), DEVICE, unit);
-	fd = refclock_open(peer->path ? peer->path : device,
-			   peer->baud ? peer->baud : SPEED232, LDISC_CLK);
+	fd = refclock_open(peer->cfg.path ? peer->cfg.path : device,
+			   peer->cfg.baud ? peer->cfg.baud : SPEED232, LDISC_CLK);
 	if (fd <= 0)
 		/* coverity[leaked_handle] */
 		return false;


=====================================
ntpd/refclock_zyfer.c
=====================================
--- a/ntpd/refclock_zyfer.c
+++ b/ntpd/refclock_zyfer.c
@@ -126,8 +126,8 @@ zyfer_start(
 	 * Something like LDISC_ACTS that looked for ! would be nice...
 	 */
 	snprintf(device, sizeof(device), DEVICE, unit);
-	fd = refclock_open(peer->path ? peer->path : device,
-			   peer->baud ? peer->baud : SPEED232,
+	fd = refclock_open(peer->cfg.path ? peer->cfg.path : device,
+			   peer->cfg.baud ? peer->cfg.baud : SPEED232,
 			   LDISC_RAW);
 	if (fd <= 0)
 		/* coverity[leaked_handle] */



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/f0a47d5e613d0dcad28c2afcf5b08e98145791fc

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/f0a47d5e613d0dcad28c2afcf5b08e98145791fc
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/20170831/25a6d4f7/attachment.html>


More information about the vc mailing list