summaryrefslogtreecommitdiffstats
path: root/plugins/netutils.c
diff options
context:
space:
mode:
authorJeremy T. Bouse <undrgrid@users.sourceforge.net>2003-06-27 18:47:45 (GMT)
committerJeremy T. Bouse <undrgrid@users.sourceforge.net>2003-06-27 18:47:45 (GMT)
commit6923e72f7f0e9d03fdf5132df9324536f5904c2f (patch)
treed4e07757c78f638f79f0f1a76c2411105c7151f9 /plugins/netutils.c
parent912e0863dd29cab4b2c637910efb1415347e9e22 (diff)
downloadmonitoring-plugins-6923e72f7f0e9d03fdf5132df9324536f5904c2f.tar.gz
Modified my_connect to include ai_socktype in the hints to be compliant with
RFC3493 as pointed out by Janos Mohacsi. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@562 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/netutils.c')
-rw-r--r--plugins/netutils.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/netutils.c b/plugins/netutils.c
index 926547e..c567df5 100644
--- a/plugins/netutils.c
+++ b/plugins/netutils.c
@@ -256,6 +256,7 @@ my_connect (char *host_name, int port, int *sd, int proto)
256 memset (&hints, 0, sizeof (hints)); 256 memset (&hints, 0, sizeof (hints));
257 hints.ai_family = PF_UNSPEC; 257 hints.ai_family = PF_UNSPEC;
258 hints.ai_protocol = proto; 258 hints.ai_protocol = proto;
259 hints.ai_socktype = (proto == IPPROTO_UDP) ? SOCK_DGRAM : SOCK_STREAM;
259 260
260 snprintf (port_str, sizeof (port_str), "%d", port); 261 snprintf (port_str, sizeof (port_str), "%d", port);
261 result = getaddrinfo (host_name, port_str, &hints, &res); 262 result = getaddrinfo (host_name, port_str, &hints, &res);