[ofw] [patch][tests][perftest] Make the server and client agree to work via IPv4.

Irena Gannon irena at mellanox.co.il
Sun Sep 19 06:54:28 PDT 2010


Signed-off-by: Irena Gannon (irena at mellanox.co.il<mailto:irena at mellanox.co.il>)

This patch makes the server and client agree to work via IPv4.
This way the socket connection that is opened in the beginning to exchange data does not fail because one of the sides works through IPv4 and the other through IPv6.

Index: D:/Windows/MLNX_VPI/tests/perftest/perftest_resources.c
===================================================================
--- D:/Windows/MLNX_VPI/tests/perftest/perftest_resources.c             (revision 6544)
+++ D:/Windows/MLNX_VPI/tests/perftest/perftest_resources.c          (revision 6545)
@@ -359,10 +359,13 @@
                }

                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))
                                                                break;
+                                             printf("Error at socket(): %ld\n", WSAGetLastError());
                                                closesocket(sockfd);
                                                sockfd = INVALID_SOCKET;
                                }
@@ -404,6 +407,8 @@
                }

                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;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100919/d2719fb9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: perftest_resourcesIPv4.patch
Type: application/octet-stream
Size: 905 bytes
Desc: perftest_resourcesIPv4.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100919/d2719fb9/attachment.obj>


More information about the ofw mailing list