diff options
author | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-06-29 06:36:55 (GMT) |
---|---|---|
committer | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | 2003-06-29 06:36:55 (GMT) |
commit | d77d183ddb8bdff5069ba5fa008406087162d117 (patch) | |
tree | 35ece18bb2080b168605c5533e4ff6b1574f9f88 /plugins/netutils.c | |
parent | cb448eb1d57259641e10494e8d74d885e44c215d (diff) | |
download | monitoring-plugins-d77d183ddb8bdff5069ba5fa008406087162d117.tar.gz |
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
Diffstat (limited to 'plugins/netutils.c')
-rw-r--r-- | plugins/netutils.c | 3 |
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 @@ | |||
35 | int socket_timeout = DEFAULT_SOCKET_TIMEOUT; | 35 | int socket_timeout = DEFAULT_SOCKET_TIMEOUT; |
36 | int econn_refuse_state = STATE_CRITICAL; | 36 | int econn_refuse_state = STATE_CRITICAL; |
37 | int was_refused = FALSE; | 37 | int was_refused = FALSE; |
38 | int address_family = AF_UNSPEC; | ||
38 | 39 | ||
39 | /* handles socket timeouts */ | 40 | /* handles socket timeouts */ |
40 | void | 41 | void |
@@ -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 | ||