[TOOLS] support the work on Server 2008, where there are both IPv4 and IPv6. [MLNX...
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 26 May 2008 09:46:46 +0000 (09:46 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 26 May 2008 09:46:46 +0000 (09:46 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1209 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

tools/perftests/user/perf_utils.c

index 395e492..be3ee49 100644 (file)
@@ -104,6 +104,8 @@ SOCKET pp_client_connect(const char *servername, int port)
        }
 
        for (t = res; t; t = t->ai_next) {
+               if (t->ai_family != AF_INET)
+                       continue;
                sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
                if (sockfd != INVALID_SOCKET) {
                        if (!connect(sockfd, t->ai_addr, t->ai_addrlen))
@@ -154,6 +156,8 @@ SOCKET pp_server_connect(int port)
        }
 
        for (t = res; t; t = t->ai_next) {
+               if (t->ai_family != AF_INET)
+                       continue;
                sockfd = socket(t->ai_family, t->ai_socktype, t->ai_protocol);
                if (sockfd != INVALID_SOCKET) {
                        n = 1;