summaryrefslogtreecommitdiffstats
path: root/plugins/netutils.c
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2016-11-17 16:22:37 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2016-11-17 16:22:37 (GMT)
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 705aaf0..1bb4f07 100644
--- a/plugins/netutils.c
+++ b/plugins/netutils.c
@@ -359,20 +359,21 @@ is_addr (const char *address)
359} 359}
360 360
361int 361int
362resolve_host_or_addr (const char *address, int family) 362dns_lookup (const char *in, struct sockaddr_storage *ss, int family)
363{ 363{
364 struct addrinfo hints; 364 struct addrinfo hints;
365 struct addrinfo *res; 365 struct addrinfo *res;
366 int retval; 366 int retval;
367 367
368 memset (&hints, 0, sizeof (hints)); 368 memset (&hints, 0, sizeof(struct addrinfo));
369 hints.ai_family = family; 369 hints.ai_family = family;
370 retval = getaddrinfo (address, NULL, &hints, &res);
371 370
371 retval = getaddrinfo (in, NULL, &hints, &res);
372 if (retval != 0) 372 if (retval != 0)
373 return FALSE; 373 return FALSE;
374 else { 374
375 freeaddrinfo (res); 375 if (ss != NULL)
376 return TRUE; 376 memcpy (ss, res->ai_addr, res->ai_addrlen);
377 } 377 freeaddrinfo (res);
378 return TRUE;
378} 379}