22343950 NTP "multicastclient 224.0.1.1" cause to open UDP Port on broadcast addr.
authorBrian Utterback <brian.utterback@oracle.com>
Tue, 26 Jan 2016 14:26:03 -0800
changeset 5362 dbf70e6a83ad
parent 5361 7e2f2fc264b8
child 5363 6759a241e5ed
22343950 NTP "multicastclient 224.0.1.1" cause to open UDP Port on broadcast addr.
components/ntp/patches/40-no-broad-sock.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ntp/patches/40-no-broad-sock.patch	Tue Jan 26 14:26:03 2016 -0800
@@ -0,0 +1,75 @@
+NTP conflates broadcast and multicast when opening sockets. The broadcast
+address does not need to be opened for multicast clients. This has been
+reported as NTP community bug 2990 (http://bugs.ntp.org/show_bug.cgi?id=2990)
+and this patch may be removed after upgrading to a version of NTP which has
+bug 2990 fixed.
+
+--- include/ntpd.h
++++ include/ntpd.h
[email protected]@ -480,6 +480,7 @@ extern struct peer *sys_peer;		/* curren
+  * Nonspecified system state variables.
+  */
+ extern int	sys_bclient;		/* we set our time to broadcasts */
++extern int	sys_mclient;		/* we set our time to multicast */
+ extern double	sys_bdelay; 		/* broadcast client default delay */
+ extern int	sys_authenticate;	/* requre authentication for config */
+ extern l_fp	sys_authdelay;		/* authentication delay */
+--- ntpd/ntp_io.c
++++ ntpd/ntp_io.c
[email protected]@ -2017,9 +2017,6 @@ update_interfaces(
+ 	 */
+ 	refresh_all_peerinterfaces();
+ 
+-	if (broadcast_client_enabled)
+-		io_setbclient();
+-
+ 	if (sys_bclient)
+ 		io_setbclient();
+ 
+--- ntpd/ntp_proto.c
++++ ntpd/ntp_proto.c
[email protected]@ -105,6 +105,7 @@ int leap_sec_in_progress;
+  * Nonspecified system state variables
+  */
+ int	sys_bclient;		/* broadcast client enable */
++int	sys_mclient;		/* multicast client enable */
+ double	sys_bdelay;		/* broadcast client default delay */
+ int	sys_authenticate;	/* requre authentication for config */
+ l_fp	sys_authdelay;		/* authentication delay */
[email protected]@ -1083,7 +1084,7 @@ receive(
+ 			return;
+ 		}
+ #endif /* AUTOKEY */
+-		if (sys_bclient == 0) {
++		if (sys_bclient == 0 && sys_mclient == 0) {
+ 			sys_restricted++;
+ 			return;			/* not enabled */
+ 		}
[email protected]@ -4209,6 +4210,7 @@ init_proto(void)
+ 	sys_survivors = 0;
+ 	sys_manycastserver = 0;
+ 	sys_bclient = 0;
++	sys_mclient = 0;
+ 	sys_bdelay = 0;
+ 	sys_authenticate = 1;
+ 	sys_stattime = current_time;
[email protected]@ -4356,7 +4358,7 @@ proto_config(
+ 	case PROTO_MULTICAST_ADD: /* add group address */
+ 		if (svalue != NULL)
+ 			io_multicast_add(svalue);
+-		sys_bclient = 1;
++		sys_mclient = 1;
+ 		break;
+ 
+ 	case PROTO_MULTICAST_DEL: /* delete group address */
+--- ntpd/ntp_request.c
++++ ntpd/ntp_request.c
[email protected]@ -1117,7 +1117,7 @@ sys_info(
+ 	is->flags = 0;
+ 	if (sys_authenticate)
+ 		is->flags |= INFO_FLAG_AUTHENTICATE;
+-	if (sys_bclient)
++	if (sys_bclient || sys_mclient)
+ 		is->flags |= INFO_FLAG_BCLIENT;
+ #ifdef REFCLOCK
+ 	if (cal_enable)