ntp: combine parameters of NCR_AddBroadcastDestination()
This commit is contained in:
parent
46714fec2d
commit
500c9cbf3b
4 changed files with 8 additions and 11 deletions
10
conf.c
10
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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 */
|
||||
|
|
2
stubs.c
2
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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue