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
@@ -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
@@ -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
@@ -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 */
@@ -1083,7 +1084,7 @@ receive(
return;
}
#endif /* AUTOKEY */
- if (sys_bclient == 0) {
+ if (sys_bclient == 0 && sys_mclient == 0) {
sys_restricted++;
return; /* not enabled */
}
@@ -4209,6 +4210,7 @@ init_proto(void)
sys_survivors = 0;
sys_manycastserver = 0;
sys_bclient = 0;
+ sys_mclient = 0;
sys_bdelay = BDELAY_DEFAULT; /*[Bug 3031] delay cutoff */
sys_authenticate = 1;
sys_stattime = current_time;
@@ -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 */
@@ -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)