mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 05:15:07 -05:00
ntp: set local address on PTP socket on FreeBSD
Fix the FreeBSD-specific code checking for a bound IPv4 socket to
include the new PTP port. This should fix a multihomed server to respond
to NTP-over-PTP requests from the address which received the request.
Fixes: be3158c4e5 ("ntp: add support for NTP over PTP")
This commit is contained in:
2
ntp_io.c
2
ntp_io.c
@@ -594,7 +594,7 @@ NIO_SendPacket(NTP_Packet *packet, NTP_Remote_Address *remote_addr,
|
|||||||
#if !defined(HAVE_IN_PKTINFO) && defined(IP_SENDSRCADDR)
|
#if !defined(HAVE_IN_PKTINFO) && defined(IP_SENDSRCADDR)
|
||||||
/* On FreeBSD a local IPv4 address cannot be specified on bound socket */
|
/* On FreeBSD a local IPv4 address cannot be specified on bound socket */
|
||||||
if (message.local_addr.ip.family == IPADDR_INET4 &&
|
if (message.local_addr.ip.family == IPADDR_INET4 &&
|
||||||
(local_addr->sock_fd != server_sock_fd4 || bound_server_sock_fd4))
|
(bound_server_sock_fd4 || !NIO_IsServerSocket(local_addr->sock_fd)))
|
||||||
message.local_addr.ip.family = IPADDR_UNSPEC;
|
message.local_addr.ip.family = IPADDR_UNSPEC;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user