From d77d183ddb8bdff5069ba5fa008406087162d117 Mon Sep 17 00:00:00 2001 From: "Jeremy T. Bouse" Date: Sun, 29 Jun 2003 06:36:55 +0000 Subject: Added address_family extern int variable to netutils to allow for -4 & -6 options for explicit connection protocol Added support for -4 & -6 options to check_ssh and check_tcp for testing git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@568 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/netutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/netutils.c') diff --git a/plugins/netutils.c b/plugins/netutils.c index c567df53..dc679e2a 100644 --- a/plugins/netutils.c +++ b/plugins/netutils.c @@ -35,6 +35,7 @@ int socket_timeout = DEFAULT_SOCKET_TIMEOUT; int econn_refuse_state = STATE_CRITICAL; int was_refused = FALSE; +int address_family = AF_UNSPEC; /* handles socket timeouts */ void @@ -254,7 +255,7 @@ my_connect (char *host_name, int port, int *sd, int proto) int result; memset (&hints, 0, sizeof (hints)); - hints.ai_family = PF_UNSPEC; + hints.ai_family = address_family; hints.ai_protocol = proto; hints.ai_socktype = (proto == IPPROTO_UDP) ? SOCK_DGRAM : SOCK_STREAM; -- cgit v1.2.3-74-g34f1