diff --git a/conf.c b/conf.c index cd775bf..f140a68 100644 --- a/conf.c +++ b/conf.c @@ -287,8 +287,7 @@ static ARR_Instance ntp_restrictions; static ARR_Instance cmd_restrictions; typedef struct { - IPAddr addr; - unsigned short port; + NTP_Remote_Address addr; int interval; } NTP_Broadcast_Destination; @@ -1345,8 +1344,8 @@ parse_broadcast(char *line) } destination = (NTP_Broadcast_Destination *)ARR_GetNewElement(broadcasts); - destination->addr = ip; - destination->port = port; + destination->addr.ip_addr = ip; + destination->addr.port = port; destination->interval = interval; } @@ -1827,8 +1826,7 @@ CNF_AddBroadcasts(void) for (i = 0; i < ARR_GetSize(broadcasts); i++) { destination = (NTP_Broadcast_Destination *)ARR_GetElement(broadcasts, i); - NCR_AddBroadcastDestination(&destination->addr, destination->port, - destination->interval); + NCR_AddBroadcastDestination(&destination->addr, destination->interval); } ARR_SetSize(broadcasts, 0); diff --git a/ntp_core.c b/ntp_core.c index 4da9e95..919c15f 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -2606,14 +2606,13 @@ broadcast_timeout(void *arg) /* ================================================== */ void -NCR_AddBroadcastDestination(IPAddr *addr, unsigned short port, int interval) +NCR_AddBroadcastDestination(NTP_Remote_Address *addr, int interval) { BroadcastDestination *destination; destination = (BroadcastDestination *)ARR_GetNewElement(broadcasts); - destination->addr.ip_addr = *addr; - destination->addr.port = port; + destination->addr = *addr; destination->local_addr.ip_addr.family = IPADDR_UNSPEC; destination->local_addr.if_index = INVALID_IF_INDEX; destination->local_addr.sock_fd = NIO_OpenServerSocket(&destination->addr); diff --git a/ntp_core.h b/ntp_core.h index 7f86f83..33f2bb8 100644 --- a/ntp_core.h +++ b/ntp_core.h @@ -139,6 +139,6 @@ extern int NCR_IsSyncPeer(NCR_Instance instance); extern void NCR_DumpAuthData(NCR_Instance inst); -extern void NCR_AddBroadcastDestination(IPAddr *addr, unsigned short port, int interval); +extern void NCR_AddBroadcastDestination(NTP_Remote_Address *addr, int interval); #endif /* GOT_NTP_CORE_H */ diff --git a/stubs.c b/stubs.c index 463a1b3..b9ad60f 100644 --- a/stubs.c +++ b/stubs.c @@ -147,7 +147,7 @@ MNL_Finalise(void) #ifndef FEAT_NTP void -NCR_AddBroadcastDestination(IPAddr *addr, unsigned short port, int interval) +NCR_AddBroadcastDestination(NTP_Remote_Address *addr, int interval) { }