mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-05-28 04:35:40 -04:00
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
This commit is contained in:
parent
912e0863dd
commit
6923e72f7f
1 changed files with 1 additions and 0 deletions
|
|
@ -256,6 +256,7 @@ my_connect (char *host_name, int port, int *sd, int proto)
|
|||
memset (&hints, 0, sizeof (hints));
|
||||
hints.ai_family = PF_UNSPEC;
|
||||
hints.ai_protocol = proto;
|
||||
hints.ai_socktype = (proto == IPPROTO_UDP) ? SOCK_DGRAM : SOCK_STREAM;
|
||||
|
||||
snprintf (port_str, sizeof (port_str), "%d", port);
|
||||
result = getaddrinfo (host_name, port_str, &hints, &res);
|
||||
|
|
|
|||
Loading…
Reference in a new issue