mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:45:07 -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:
17
socket.c
17
socket.c
@@ -1115,6 +1115,23 @@ SCK_Finalise(void)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
int
|
||||
SCK_IsFamilySupported(int family)
|
||||
{
|
||||
switch (family) {
|
||||
case IPADDR_INET4:
|
||||
return 1;
|
||||
case IPADDR_INET6:
|
||||
#ifdef FEAT_IPV6
|
||||
return 1;
|
||||
#endif
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
void
|
||||
SCK_GetAnyLocalIPAddress(int family, IPAddr *local_addr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user