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:
Miroslav Lichvar
2020-01-03 09:36:59 +01:00
parent bfcd8ecc56
commit dd0679ad45
4 changed files with 24 additions and 1 deletions

View File

@@ -82,6 +82,9 @@ extern void SCK_Initialise(void);
/* Finalisation function */
extern void SCK_Finalise(void);
/* Check if support for the IP family was enabled in the build */
extern int SCK_IsFamilySupported(int family);
/* Get the 0.0.0.0/::0 or 127.0.0.1/::1 address */
extern void SCK_GetAnyLocalIPAddress(int family, IPAddr *local_addr);
extern void SCK_GetLoopbackIPAddress(int family, IPAddr *local_addr);