*/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "configfile.h"
static int wg_callback_init (struct wg_callback *cb)
{
- struct addrinfo ai_hints = { 0 };
struct addrinfo *ai_list;
struct addrinfo *ai_ptr;
cdtime_t now;
return (EAGAIN);
cb->last_connect_time = now;
-#ifdef AI_ADDRCONFIG
- ai_hints.ai_flags |= AI_ADDRCONFIG;
-#endif
- ai_hints.ai_family = AF_UNSPEC;
+ struct addrinfo ai_hints = {
+ .ai_family = AF_UNSPEC,
+ .ai_flags = AI_ADDRCONFIG
+ };
if (0 == strcasecmp ("tcp", cb->protocol))
ai_hints.ai_socktype = SOCK_STREAM;
else
ai_hints.ai_socktype = SOCK_DGRAM;
- ai_list = NULL;
-
status = getaddrinfo (cb->node, cb->service, &ai_hints, &ai_list);
if (status != 0)
{