Fix setting up hints for getaddrinfo (#2872)
authorkparzysz <48801706+kparzysz@users.noreply.github.com>
Sat, 23 Mar 2019 01:24:00 +0000 (20:24 -0500)
committerTianqi Chen <tqchen@users.noreply.github.com>
Sat, 23 Mar 2019 01:24:00 +0000 (18:24 -0700)
src/common/socket.h

index fafff97..5c39f40 100644 (file)
@@ -65,7 +65,7 @@ struct SockAddr {
     memset(&hints, 0, sizeof(hints));
     hints.ai_family = PF_UNSPEC;
     hints.ai_flags = AI_PASSIVE;
-    hints.ai_protocol = SOCK_STREAM;
+    hints.ai_socktype = SOCK_STREAM;
     addrinfo *res = NULL;
     int sig = getaddrinfo(host, NULL, &hints, &res);
     CHECK(sig == 0 && res != NULL)