aboutsummaryrefslogtreecommitdiff
path: root/plugins/netutils.c
diff options
context:
space:
mode:
authorGravatar Holger Weiss <holger@zedat.fu-berlin.de> 2016-11-17 17:22:37 +0100
committerGravatar Holger Weiss <holger@zedat.fu-berlin.de> 2016-11-17 17:22:37 +0100
commit487a9d0a8b0700c06857d4bc35423db4e4dbc3d6 (patch)
treeabfdc545a658550e32a69f0dfdd8ace3aa9f5a41 /plugins/netutils.c
parentbfc745a79d4912479b725c00375aa171f8528ca2 (diff)
downloadmonitoring-plugins-487a9d0a8b0700c06857d4bc35423db4e4dbc3d6.tar.gz
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.
Diffstat (limited to 'plugins/netutils.c')
-rw-r--r--plugins/netutils.c15
1 files changed, 8 insertions, 7 deletions
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;
}