From 487a9d0a8b0700c06857d4bc35423db4e4dbc3d6 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Thu, 17 Nov 2016 17:22:37 +0100 Subject: check_radius: Replace functions removed in radcli The radcli library no longer offers the rc_get_ipaddr(), rc_good_ipaddr(), and rc_own_ipaddress() functions. --- plugins/netutils.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'plugins/netutils.c') diff --git a/plugins/netutils.c b/plugins/netutils.c index 705aaf09..1bb4f076 100644 --- a/plugins/netutils.c +++ b/plugins/netutils.c @@ -359,20 +359,21 @@ is_addr (const char *address) } int -resolve_host_or_addr (const char *address, int family) +dns_lookup (const char *in, struct sockaddr_storage *ss, int family) { struct addrinfo hints; struct addrinfo *res; int retval; - memset (&hints, 0, sizeof (hints)); + memset (&hints, 0, sizeof(struct addrinfo)); hints.ai_family = family; - retval = getaddrinfo (address, NULL, &hints, &res); + retval = getaddrinfo (in, NULL, &hints, &res); if (retval != 0) return FALSE; - else { - freeaddrinfo (res); - return TRUE; - } + + if (ss != NULL) + memcpy (ss, res->ai_addr, res->ai_addrlen); + freeaddrinfo (res); + return TRUE; } -- cgit v1.2.3