mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
socket: add function to check supported family
Don't log error when an IPv6 socket cannot be opened and chronyd was built without IPv6 support. Reported-by: Lonnie Abelbeck <lonnie@abelbeck.com>
This commit is contained in:
3
ntp_io.c
3
ntp_io.c
@@ -86,6 +86,9 @@ open_socket(int family, int local_port, int client_only, IPSockAddr *remote_addr
|
||||
int sock_fd, sock_flags, events = SCH_FILE_INPUT;
|
||||
IPSockAddr local_addr;
|
||||
|
||||
if (!SCK_IsFamilySupported(family))
|
||||
return INVALID_SOCK_FD;
|
||||
|
||||
if (!client_only)
|
||||
CNF_GetBindAddress(family, &local_addr.ip_addr);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user