[Git][NTPsec/ntpsec][master] 7 commits: Remove unused T_Port and T_Trap

Hal Murray gitlab at mg.gitlab.com
Tue Jul 3 21:06:08 UTC 2018


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
97b60b05 by Hal Murray at 2018-06-30T22:59:51Z
Remove unused T_Port and T_Trap

- - - - -
26dc3936 by Hal Murray at 2018-07-03T01:45:31Z
Remove unused cast_flags from mon_data

- - - - -
ec113a4a by Hal Murray at 2018-07-03T01:49:58Z
Remove unused cast_flags from recvbuf

- - - - -
8e0d5862 by Hal Murray at 2018-07-03T02:53:31Z
Remove unused bfd (broadcast fd) from endpt (interface)

- - - - -
e241e0e2 by Hal Murray at 2018-07-03T05:43:06Z
Remove MDF_BCAST and several chunks of code - leftover broadcast

- - - - -
5b0b667d by Hal Murray at 2018-07-03T06:20:48Z
Remove enable_broadcast (more broadcast cleanup)

- - - - -
3baef21b by Hal Murray at 2018-07-03T08:08:38Z
Remove unused socket_broadcast_enable and socket_broadcast_disable

- - - - -


10 changed files:

- include/ntp.h
- include/ntpd.h
- include/recvbuff.h
- ntpd/keyword-gen.c
- ntpd/ntp_io.c
- ntpd/ntp_monitor.c
- ntpd/ntp_parser.y
- ntpd/ntp_peer.c
- ntpd/ntp_proto.c
- wscript


Changes:

=====================================
include/ntp.h
=====================================
--- a/include/ntp.h
+++ b/include/ntp.h
@@ -117,7 +117,6 @@ extern int32_t ntp_random (void);
 typedef struct __endpt {
 	struct __endpt *elink;		/* endpt list link */
 	SOCKET		fd;		/* socket descriptor */
-	SOCKET		bfd;		/* for receiving broadcasts */
 	uint32_t	ifnum;		/* endpt instance count */
 	sockaddr_u	sin;		/* unicast address */
 	sockaddr_u	mask;		/* subnet mask */
@@ -145,13 +144,13 @@ typedef struct __endpt {
 #define	INT_PPP		0x002	/* Point-to-point interface */
 #define	INT_LOOPBACK	0x004U	/* the loopback interface */
 #define	INT_BROADCAST	0x008	/* can broadcast out this interface */
-#define INT_MULTICAST	0x010	/* can multicast out this interface */
+/* #define INT_MULTICAST	0x010	** can multicast out this interface */
 #define	INT_BCASTOPEN	0x020U	/* broadcast receive socket is open */
-#define INT_MCASTOPEN	0x040	/* multicasting enabled */
+/* #define INT_MCASTOPEN	0x040	** multicasting enabled */
 #define INT_WILDCARD	0x080	/* wildcard interface - usually skipped */
 #define INT_MCASTIF	0x100	/* bound directly to MCAST address */
 #define INT_PRIVACY	0x200	/* RFC 4941 IPv6 privacy address */
-#define INT_BCASTXMIT	0x400   /* socket setup to allow broadcasts */
+/* #define INT_BCASTXMIT	0x400   ** socket setup to allow broadcasts */
 
 /*
  * Read-only control knobs for a peer structure.
@@ -604,7 +603,6 @@ struct mon_data {
 	int		count;		/* total packet count */
 	unsigned short	flags;		/* restrict flags */
 	uint8_t		vn_mode;	/* packet mode & version */
-	uint8_t		cast_flags;	/* flags MDF_?CAST */
 	sockaddr_u	rmtadr;		/* address of remote host */
 };
 
@@ -614,7 +612,7 @@ struct mon_data {
  */
 #define	MDF_UCAST	0x01	/* unicast client */
 /* #define MDF_MCAST	0x02	** multicast server (not used) */
-#define	MDF_BCAST	0x04	/* broadcast server */
+/* #define MDF_BCAST	0x04	** broadcast server (not used) */
 #define	MDF_POOL	0x08	/* pool client solicitor */
 /* #define MDF_ACAST	0x10	** manycast client solicitor (not used) */
 #define	MDF_BCLNT	0x20	/* eph. broadcast/multicast client */
@@ -622,9 +620,9 @@ struct mon_data {
 /*
  * In the context of struct peer in ntpd, one cast_flags bit
  * represent configured associations which never receive packets, and
- * whose reach is always 0: MDF_BCAST
+ * whose reach is always 0: MDF_BCAST  (Historical)
  */
-#define MDF_TXONLY_MASK	(MDF_BCAST | MDF_POOL)
+#define MDF_TXONLY_MASK	(MDF_POOL)
 /*
  * manycastclient-like solicitor association cast_flags bits
  */


=====================================
include/ntpd.h
=====================================
--- a/include/ntpd.h
+++ b/include/ntpd.h
@@ -89,11 +89,9 @@ extern	endpt *	getinterface		(sockaddr_u *, uint32_t);
 extern	endpt *	select_peerinterface	(struct peer *, sockaddr_u *,
 					 endpt *);
 extern	endpt *	findinterface		(sockaddr_u *);
-extern	void	enable_broadcast	(endpt *, sockaddr_u *);
 extern	void	interface_update	(interface_receiver_t, void *);
 extern  void    io_handler              (void);
 extern	void	init_io 	(void);
-extern  SOCKET	open_socket	(sockaddr_u *, bool, bool, endpt *);
 extern	void	io_open_sockets	(void);
 extern	void	io_clr_stats	(void);
 extern	void	sendpkt 	(sockaddr_u *, endpt *, void *, int);


=====================================
include/recvbuff.h
=====================================
--- a/include/recvbuff.h
+++ b/include/recvbuff.h
@@ -38,7 +38,6 @@ struct recvbuf {
 	sockaddr_u	srcadr;		/* where packet came from */
 	endpt *		dstadr;		/* address pkt arrived on */
 	SOCKET		fd;		/* fd on which it was received */
-	int		cast_flags;	/* unicast/broadcast/manycast mode */
 	l_fp		recv_time;	/* time of arrival */
 	void		(*receiver)(struct recvbuf *); /* callback */
 	size_t		recv_length;	/* number of octets received */


=====================================
ntpd/keyword-gen.c
=====================================
--- a/ntpd/keyword-gen.c
+++ b/ntpd/keyword-gen.c
@@ -187,7 +187,6 @@ struct key_tok ntp_keywords[] = {
 { "huffpuff",		T_Huffpuff,		FOLLBY_TOKEN },
 { "freq",		T_Freq,			FOLLBY_TOKEN },
 /* miscellaneous_command */
-{ "port",		T_Port,			FOLLBY_TOKEN },
 { "interface",		T_Interface,		FOLLBY_TOKEN },
 /* interface_command (ignore and interface already defined) */
 { "nic",		T_Nic,			FOLLBY_TOKEN },


=====================================
ntpd/ntp_io.c
=====================================
--- a/ntpd/ntp_io.c
+++ b/ntpd/ntp_io.c
@@ -110,6 +110,7 @@ unsigned int sys_ifnum;			/* next .ifnum to assign */
 static int ninterfaces;			/* total # of interfaces */
 
 bool disable_dynamic_updates;	/* if true, scan interfaces once only */
+extern  SOCKET  open_socket     (sockaddr_u *, bool, endpt *);
 
 static bool
 netaddr_eqprefix(const isc_netaddr_t *, const isc_netaddr_t *,
@@ -214,10 +215,6 @@ static	bool	addr_eqprefix	(const sockaddr_u *, const sockaddr_u *,
 				 int);
 static	int	create_sockets	(unsigned short);
 static	void	set_reuseaddr	(int);
-static	bool	socket_broadcast_enable	 (endpt *, SOCKET, sockaddr_u *);
-#ifdef  OS_MISSES_SPECIFIC_ROUTE_UPDATES
-static	bool	socket_broadcast_disable (endpt *, sockaddr_u *);
-#endif
 
 typedef struct remaddr remaddr_t;
 
@@ -243,7 +240,6 @@ static void	add_addr_to_list	(sockaddr_u *, endpt *);
 static void	create_wildcards	(unsigned short);
 static endpt *	findlocalinterface	(sockaddr_u *, int, int);
 static endpt *	findclosestinterface	(sockaddr_u *, int);
-static endpt *	findbcastinter		(sockaddr_u *);
 
 #ifdef DEBUG
 static const char *	action_text	(nic_rule_action);
@@ -424,7 +420,6 @@ interface_dump(const endpt *itf)
 {
 	printf("Dumping interface: %p\n", itf);
 	printf("fd = %d\n", itf->fd);
-	printf("bfd = %d\n", itf->bfd);
 	printf("sin = %s,\n", socktoa(&itf->sin));
 	sockaddr_dump(&itf->sin);
 	printf("bcast = %s,\n", socktoa(&itf->bcast));
@@ -469,12 +464,11 @@ sockaddr_dump(const sockaddr_u *psau)
 static void
 print_interface(const endpt *iface, const char *pfx, const char *sfx)
 {
-	printf("%sinterface #%u: fd=%d, bfd=%d, name=%s, "
+	printf("%sinterface #%u: fd=%d, name=%s, "
                "flags=0x%x, ifindex=%u, sin=%s",
 	       pfx,
 	       iface->ifnum,
 	       iface->fd,
-	       iface->bfd,
 	       iface->name,
 	       iface->flags,
 	       iface->ifindex,
@@ -736,7 +730,6 @@ init_interface(
 {
 	ZERO(*ep);
 	ep->fd = INVALID_SOCKET;
-	ep->bfd = INVALID_SOCKET;
 	ep->phase = sys_interphase;
 }
 
@@ -828,16 +821,6 @@ remove_interface(
 		ep->fd = INVALID_SOCKET;
 	}
 
-	if (ep->bfd != INVALID_SOCKET) {
-		msyslog(LOG_INFO,
-			"IO: stop listening for broadcasts to %s "
-                        "on interface #%u %s",
-			socktoa(&ep->bcast), ep->ifnum, ep->name);
-		close_and_delete_fd_from_list(ep->bfd);
-		ep->bfd = INVALID_SOCKET;
-		ep->flags &= ~INT_BCASTOPEN;
-	}
-
 	ninterfaces--;
 	mon_clearinterface(ep);
 
@@ -911,7 +894,7 @@ create_wildcards(
 		wildif->flags = INT_UP | INT_WILDCARD;
 		wildif->ignore_packets = (ACTION_DROP == action);
 
-		wildif->fd = open_socket(&wildif->sin, 0, 1, wildif);
+		wildif->fd = open_socket(&wildif->sin, true, wildif);
 
 		if (wildif->fd != INVALID_SOCKET) {
 			wildipv6 = wildif;
@@ -953,7 +936,7 @@ create_wildcards(
 
 		wildif->flags = INT_BROADCAST | INT_UP | INT_WILDCARD;
 		wildif->ignore_packets = (ACTION_DROP == action);
-		wildif->fd = open_socket(&wildif->sin, 0, 1, wildif);
+		wildif->fd = open_socket(&wildif->sin, true, wildif);
 
 		if (wildif->fd != INVALID_SOCKET) {
 			wildipv4 = wildif;
@@ -1270,18 +1253,11 @@ refresh_interface(
 {
 #ifdef  OS_MISSES_SPECIFIC_ROUTE_UPDATES
 	if (interface->fd != INVALID_SOCKET) {
-		int bcast = (interface->flags & INT_BCASTXMIT) != 0;
-		/* as we forcibly close() the socket remove the
-		   broadcast permission indication */
-		if (bcast)
-			socket_broadcast_disable(interface, &interface->sin);
-
 		close_and_delete_fd_from_list(interface->fd);
 
 		/* create new socket picking up a new first hop binding
 		   at connect() time */
-		interface->fd = open_socket(&interface->sin,
-					    bcast, 0, interface);
+		interface->fd = open_socket(&interface->sin, false, interface);
 		 /*
 		  * reset TTL indication so TTL is is set again
 		  * next time around
@@ -1784,18 +1760,12 @@ create_interface(
 	/*
 	 * create socket
 	 */
-	iface->fd = open_socket(&iface->sin, 0, 0, iface);
+	iface->fd = open_socket(&iface->sin, false, iface);
 
 	if (iface->fd != INVALID_SOCKET)
 		log_listen_address(iface);
 
-	if ((INT_BROADCAST & iface->flags)
-	    && iface->bfd != INVALID_SOCKET)
-		msyslog(LOG_INFO, "IO: Listening on broadcast address %s#%d",
-			socktoa((&iface->bcast)), port);
-
-	if (INVALID_SOCKET == iface->fd
-	    && INVALID_SOCKET == iface->bfd) {
+	if (INVALID_SOCKET == iface->fd) {
 		msyslog(LOG_ERR, "IO: unable to create socket on %s (%u) for %s#%d",
 			iface->name,
 			iface->ifnum,
@@ -1890,85 +1860,12 @@ set_reuseaddr(
 }
 
 /*
- * This is just a wrapper around an internal function so we can
- * make other changes as necessary later on
- */
-void
-enable_broadcast(
-	endpt *	iface,
-	sockaddr_u *		baddr
-	)
-{
-#ifdef OPEN_BCAST_SOCKET
-	socket_broadcast_enable(iface, iface->fd, baddr);
-#endif
-}
-
-#ifdef OPEN_BCAST_SOCKET
-/*
- * Enable a broadcast address to a given socket
- * The socket is in the ep_list all we need to do is enable
- * broadcasting. It is not this function's job to select the socket
- */
-static bool
-socket_broadcast_enable(
-	endpt *	iface,
-	SOCKET			fd,
-	sockaddr_u *		baddr
-	)
-{
-	int on = 1;
-
-	if (IS_IPV4(baddr)) {
-		/* if this interface can support broadcast, set SO_BROADCAST */
-		if (setsockopt(fd, SOL_SOCKET, SO_BROADCAST,
-			       (char *)&on, sizeof(on)))
-			msyslog(LOG_ERR,
-				"IO: setsockopt(SO_BROADCAST) enable failure on address %s: %m",
-				socktoa(baddr));
-		else
-			DPRINT(2, ("Broadcast enabled on socket %d for address %s\n",
-				   fd, socktoa(baddr)));
-	}
-	iface->flags |= INT_BCASTXMIT;
-	return true;
-}
-
-#ifdef  OS_MISSES_SPECIFIC_ROUTE_UPDATES
-/*
- * Remove a broadcast address from a given socket
- * The socket is in the ep_list all we need to do is disable
- * broadcasting. It is not this function's job to select the socket
- */
-static bool
-socket_broadcast_disable(
-	endpt *	iface,
-	sockaddr_u *		baddr
-	)
-{
-	int off = 0;	/* This seems to be OK as an int */
-
-	if (IS_IPV4(baddr) && setsockopt(iface->fd, SOL_SOCKET,
-	    SO_BROADCAST, (char *)&off, sizeof(off)))
-		msyslog(LOG_ERR,
-			"IO: setsockopt(SO_BROADCAST) disable failure on address %s: %m",
-			socktoa(baddr));
-
-	iface->flags &= ~INT_BCASTXMIT;
-	return true;
-}
-#endif /* OS_MISSES_SPECIFIC_ROUTE_UPDATES */
-
-#endif /* OPEN_BCAST_SOCKET */
-
-/*
  * open_socket - open a socket, returning the file descriptor
  */
 
 SOCKET
 open_socket(
 	sockaddr_u *	addr,
-	bool		bcast,
 	bool		turn_off_reuse,
 	endpt *		interf
 	)
@@ -2051,8 +1948,6 @@ open_socket(
 				"IO: setsockopt IP_TOS (%02x) fails on "
                                 "address %s: %m",
 				(unsigned)qos, socktoa(addr));
-		if (bcast)
-			socket_broadcast_enable(interf, fd, addr);
 	}
 
 	/*
@@ -2234,7 +2129,6 @@ read_refclock_packet(
 	rb->recv_length = (size_t)buflen;
 	rb->recv_peer = rp->srcclock;
 	rb->dstadr = 0;
-	rb->cast_flags = 0;
 	rb->fd = fd;
 	rb->recv_time = ts;
 	rb->receiver = rp->clock_recv;
@@ -2369,7 +2263,6 @@ read_network_packet(
 	 * put it on the full list and do bookkeeping.
 	 */
 	rb->dstadr = itf;
-	rb->cast_flags = (uint8_t)(rb->fd == rb->dstadr->bfd ? MDF_BCAST : MDF_UCAST);
 	rb->fd = fd;
 	ts = fetch_packetstamp(rb, &msghdr, ts);
 	rb->recv_time = ts;
@@ -2441,7 +2334,6 @@ input_handler(
 	)
 {
 	int		buflen;
-	int		doing;
 	SOCKET		fd;
 	l_fp		ts;	/* Timestamp at BOselect() gob */
 #ifdef ENABLE_DEBUG_TIMING
@@ -2516,24 +2408,12 @@ input_handler(
 	 * Loop through the interfaces looking for data to read.
 	 */
 	for (ep = ep_list; ep != NULL; ep = ep->elink) {
-		for (doing = 0; doing < 2; doing++) {
-			if (!doing) {
-				fd = ep->fd;
-			} else {
-				if (!(ep->flags & INT_BCASTOPEN))
-					break;
-				fd = ep->bfd;
-			}
-			if (fd < 0)
-				continue;
-			if (FD_ISSET(fd, fds))
-				do {
-					++select_count;
-					buflen = read_network_packet(
-							fd, ep, ts);
-				} while (buflen > 0);
-			/* Check more interfaces */
-		}
+		fd = ep->fd;
+		if (FD_ISSET(fd, fds))
+			do {
+				++select_count;
+				buflen = read_network_packet(fd, ep, ts);
+			} while (buflen > 0);
 	}
 
 #ifdef USE_ROUTING_SOCKET
@@ -2597,6 +2477,11 @@ select_peerinterface(
 	endpt *ep;
 	endpt *wild;
 
+#ifndef REFCLOCK
+	UNUSED_ARG(peer);
+#endif
+
+
 	wild = ANY_INTERFACE_CHOOSE(srcadr);
 
 	/*
@@ -2609,14 +2494,6 @@ select_peerinterface(
 	 */
 	if (IS_PEER_REFCLOCK(peer)) {
 		ep = loopback_interface;
-	} else if (peer->cast_flags & MDF_BCAST) {
-		ep = findbcastinter(srcadr);
-		if (ep != NULL)
-			DPRINT(4, ("Found *-cast interface %s for address %s\n",
-				   socktoa(&ep->sin), socktoa(srcadr)));
-		else
-			DPRINT(4, ("No *-cast local address found for address %s\n",
-				   socktoa(srcadr)));
 	} else {
 		ep = dstadr;
 		if (NULL == ep)
@@ -2920,88 +2797,6 @@ getinterface(
 	return iface;
 }
 
-
-/*
- * findbcastinter - find broadcast interface corresponding to address
- */
-static endpt *
-findbcastinter(
-	sockaddr_u *addr
-	)
-{
-	endpt *	iface;
-
-	iface = NULL;
-#if defined(SIOCGIFCONF)
-	DPRINT(4, ("Finding broadcast interface for addr %s in list of addresses\n",
-		   socktoa(addr)));
-
-	iface = findlocalinterface(addr, INT_LOOPBACK | INT_WILDCARD,
-				   1);
-	if (iface != NULL) {
-		DPRINT(4, ("Easily found bcast-/mcast- interface index #%d %s\n",
-			   iface->ifnum, iface->name));
-		return iface;
-	}
-
-	/*
-	 * plan B - try to find something reasonable in our lists in
-	 * case kernel lookup doesn't help
-	 */
-	for (iface = ep_list; iface != NULL; iface = iface->elink) {
-		if (iface->flags & INT_WILDCARD)
-			continue;
-
-		/* Don't bother with ignored interfaces */
-		if (iface->ignore_packets)
-			continue;
-
-		/*
-		 * First look if this is the correct family
-		 */
-		if(AF(&iface->sin) != AF(addr))
-			continue;
-
-		/* Skip the loopback addresses */
-		if (iface->flags & INT_LOOPBACK)
-			continue;
-
-		/*
-		 * We match only those interfaces marked as
-		 * broadcastable and either the explicit broadcast
-		 * address or the network portion of the IP address.
-		 * Sloppy.
-		 */
-		if (IS_IPV4(addr)) {
-			if (SOCK_EQ(&iface->bcast, addr))
-				break;
-
-			if ((NSRCADR(&iface->sin) & NSRCADR(&iface->mask))
-			    == (NSRCADR(addr)	  & NSRCADR(&iface->mask)))
-				break;
-		}
-		else if (IS_IPV6(addr)) {
-			if (SOCK_EQ(&iface->bcast, addr))
-				break;
-
-			if (SOCK_EQ(netof6(&iface->sin), netof6(addr)))
-				break;
-		}
-	}
-#endif /* SIOCGIFCONF */
-	if (NULL == iface) {
-		DPRINT(4, ("No bcast interface found for %s\n",
-			   socktoa(addr)));
-		iface = ANY_INTERFACE_CHOOSE(addr);
-	} else {
-		DPRINT(4, ("Found bcast-/mcast- interface index #%u %s\n",
-			   iface->ifnum, iface->name));
-	}
-
-	return iface;
-}
-
-
 /*
  * io_clr_stats - clear I/O module statistics
  */


=====================================
ntpd/ntp_monitor.c
=====================================
--- a/ntpd/ntp_monitor.c
+++ b/ntpd/ntp_monitor.c
@@ -464,7 +464,6 @@ ntp_monitor(
 	memcpy(&mon->rmtadr, &rbufp->recv_srcadr, sizeof(mon->rmtadr));
 	mon->vn_mode = VN_MODE(version, mode);
 	mon->lcladr = rbufp->dstadr;
-	mon->cast_flags = rbufp->cast_flags;
 
 	/*
 	 * Drop him into front of the hash table. Also put him on top of


=====================================
ntpd/ntp_parser.y
=====================================
--- a/ntpd/ntp_parser.y
+++ b/ntpd/ntp_parser.y
@@ -71,7 +71,7 @@
 %token	<Integer>	T_Disable
 %token	<Integer>	T_Discard
 %token	<Integer>	T_Dispersion
-%token	<Double>	T_Double		/* not a token */
+%token	<Double>	T_Double		/* Not a token */
 %token	<Integer>	T_Driftfile
 %token	<Integer>	T_Drop
 %token	<Integer>	T_Dscp
@@ -99,9 +99,9 @@
 %token	<Integer>	T_Initalloc
 %token	<Integer>	T_Initmem
 %token	<Integer>	T_Includefile
-%token	<Integer>	T_Integer		/* not a token */
+%token	<Integer>	T_Integer		/* Not a token, used as tag */
 %token	<Integer>	T_Interface
-%token	<Integer>	T_Intrange		/* not a token */
+%token	<Integer>	T_Intrange		/* Not a token, used as tag */
 %token	<Integer>	T_Io
 %token	<Integer>	T_Ipv4
 %token	<Integer>	T_Ipv4_flag
@@ -168,7 +168,6 @@
 %token	<Integer>	T_Pidfile
 %token	<Integer>	T_Pool
 %token	<Integer>	T_Ppspath
-%token	<Integer>	T_Port
 %token	<Integer>	T_Prefer
 %token	<Integer>	T_Protostats
 %token	<Integer>	T_Rawstats
@@ -192,7 +191,7 @@
 %token	<Integer>	T_Stepout
 %token	<Integer>	T_Stratum
 %token	<Integer>	T_Subtype
-%token	<String>	T_String		/* not a token */
+%token	<String>	T_String		/* Not a token */
 %token	<Integer>	T_Sys
 %token	<Integer>	T_Sysstats
 %token	<Integer>	T_Tick
@@ -202,7 +201,6 @@
 %token	<Integer>	T_Timingstats
 %token	<Integer>	T_Tinker
 %token	<Integer>	T_Tos
-%token	<Integer>	T_Trap
 %token	<Integer>	T_True
 %token	<Integer>	T_Trustedkey
 %token	<Integer>	T_Type
@@ -213,11 +211,11 @@
 %token	<Integer>	T_Unrestrict
 %token	<Integer>	T_Usestats
 %token	<Integer>	T_Version
-%token	<Integer>	T_WanderThreshold	/* Not a token */
+%token	<Integer>	T_WanderThreshold	/* Not a token, used as tag */
 %token	<Integer>	T_Week
 %token	<Integer>	T_Wildcard
 %token	<Integer>	T_Year
-%token	<Integer>	T_Flag			/* Not a token */
+%token	<Integer>	T_Flag			/* Not a token, used as tag */
 %token	<Integer>	T_EOC
 
 /*** NON-TERMINALS ***/
@@ -501,7 +499,6 @@ unpeer_keyword
 	
 	
 /* Other Modes
- * (manycastserver)
  * ------------------------------------------------
  */
 


=====================================
ntpd/ntp_peer.c
=====================================
--- a/ntpd/ntp_peer.c
+++ b/ntpd/ntp_peer.c
@@ -490,8 +490,8 @@ peer_refresh_interface(
 		   p->cfg.mode, p->cfg.peerkey));
 	if (niface != NULL) {
 		DPRINT(4, (
-			   "fd=%d, bfd=%d, name=%.16s, flags=0x%x, ifindex=%u, sin=%s",
-			   niface->fd,  niface->bfd, niface->name,
+			   "fd=%d, name=%.16s, flags=0x%x, ifindex=%u, sin=%s",
+			   niface->fd, niface->name,
 			   niface->flags, niface->ifindex,
 			   socktoa(&niface->sin)));
 		if (niface->flags & INT_BROADCAST)
@@ -654,12 +654,6 @@ newpeer(
 		DPRINT(3, ("newpeer(%s): local interface currently not bound\n",
 			   socktoa(srcadr)));
 
-	/*
-	 * Broadcast needs the socket enabled for broadcast
-	 */
-	if ((MDF_BCAST & cast_flags) && peer->dstadr != NULL)
-		enable_broadcast(peer->dstadr, srcadr);
-
 	/* if a key specified, verify that it will work */
 	if (0 != peer->cfg.peerkey) {
 		if (NULL == authlookup(peer->cfg.peerkey, false))
@@ -674,8 +668,6 @@ newpeer(
 	peer->hpoll = peer->cfg.minpoll;
 	if (cast_flags & MDF_POOL)
 		peer_clear(peer, "POOL", initializing1);
-	else if (cast_flags & MDF_BCAST)
-		peer_clear(peer, "BCST", initializing1);
 	else
 		peer_clear(peer, "INIT", initializing1);
 	if (clock_ctl.mode_ntpdate)


=====================================
ntpd/ntp_proto.c
=====================================
--- a/ntpd/ntp_proto.c
+++ b/ntpd/ntp_proto.c
@@ -797,18 +797,6 @@ transmit(
 	hpoll = peer->hpoll;
 
 	/*
-	 * In broadcast mode the poll interval is never changed from
-	 * minpoll.
-	 */
-	if (peer->cast_flags & MDF_BCAST) {
-		peer->outdate = current_time;
-		if (sys_vars.sys_leap != LEAP_NOTINSYNC)
-			peer_xmit(peer);
-		poll_update(peer, hpoll);
-		return;
-	}
-
-	/*
 	 * Pool associations transmit unicast solicitations when there
 	 * are less than a hard limit of 2 * sys_maxclock associations,
 	 * and either less than sys_minclock survivors or less than


=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -596,10 +596,6 @@ int main(int argc, char **argv) {
     for header, sizeof in sorted(sizeofs, key=lambda x: x[1:]):
         check_sizeof(ctx, header, sizeof)
 
-    # These are helpful and don't break Linux or *BSD
-    ctx.define("OPEN_BCAST_SOCKET", 1,
-               comment="Whether to open a broadcast socket")
-
     # Check via pkg-config first, then fall back to a direct search
     if not ctx.check_cfg(
         package='libcrypto', uselib_store='CRYPTO',



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/0bcd6a2b2c2c3771ff86b8f0d0c2397a25195465...3baef21b89524efe5eaf3b9fb0b76a922c15957b

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/0bcd6a2b2c2c3771ff86b8f0d0c2397a25195465...3baef21b89524efe5eaf3b9fb0b76a922c15957b
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/20180703/e86b6ffc/attachment.html>


More information about the vc mailing list