mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Bugfix for TCPSocket::Bind()
This commit is contained in:
parent
28bdbe1ffe
commit
fbfff23923
@ -28,12 +28,12 @@ void TCPSocket::Bind(string node, string service, int family)
|
||||
addrinfo *result;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_family = family;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_protocol = IPPROTO_TCP;
|
||||
hints.ai_flags = AI_PASSIVE;
|
||||
|
||||
if (getaddrinfo(node.c_str(), service.c_str(), &hints, &result) < 0) {
|
||||
if (getaddrinfo(node.empty() ? NULL : node.c_str(), service.c_str(), &hints, &result) < 0) {
|
||||
HandleSocketError();
|
||||
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user