summaryrefslogtreecommitdiffstats
path: root/plugins/netutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/netutils.c')
-rw-r--r--plugins/netutils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/netutils.c b/plugins/netutils.c
index c567df5..dc679e2 100644
--- a/plugins/netutils.c
+++ b/plugins/netutils.c
@@ -35,6 +35,7 @@
35int socket_timeout = DEFAULT_SOCKET_TIMEOUT; 35int socket_timeout = DEFAULT_SOCKET_TIMEOUT;
36int econn_refuse_state = STATE_CRITICAL; 36int econn_refuse_state = STATE_CRITICAL;
37int was_refused = FALSE; 37int was_refused = FALSE;
38int address_family = AF_UNSPEC;
38 39
39/* handles socket timeouts */ 40/* handles socket timeouts */
40void 41void
@@ -254,7 +255,7 @@ my_connect (char *host_name, int port, int *sd, int proto)
254 int result; 255 int result;
255 256
256 memset (&hints, 0, sizeof (hints)); 257 memset (&hints, 0, sizeof (hints));
257 hints.ai_family = PF_UNSPEC; 258 hints.ai_family = address_family;
258 hints.ai_protocol = proto; 259 hints.ai_protocol = proto;
259 hints.ai_socktype = (proto == IPPROTO_UDP) ? SOCK_DGRAM : SOCK_STREAM; 260 hints.ai_socktype = (proto == IPPROTO_UDP) ? SOCK_DGRAM : SOCK_STREAM;
260 261