[netperf-dev] netperf2 commit notice r208 - trunk/src

raj at netperf.org raj at netperf.org
Fri Feb 1 17:27:14 PST 2008


Author: raj
Date: 2008-02-01 17:27:13 -0800 (Fri, 01 Feb 2008)
New Revision: 208

Modified:
   trunk/src/netlib.c
   trunk/src/nettest_bsd.c
Log:
some netlib dccp support an a MASSIVE KLUDGE for DCCP SO_REUSEADDR on Linux

Modified: trunk/src/netlib.c
===================================================================
--- trunk/src/netlib.c	2008-02-02 00:52:49 UTC (rev 207)
+++ trunk/src/netlib.c	2008-02-02 01:27:13 UTC (rev 208)
@@ -450,6 +450,10 @@
   case SOCK_STREAM:
     return("SOCK_STREAM");
     break;
+#ifdef SOCK_DCCP
+  case SOCK_DCCP:
+    return "SOCK_DCCP";
+#endif
   default:
     return("SOCK_UNKNOWN");
   }

Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c	2008-02-02 00:52:49 UTC (rev 207)
+++ trunk/src/nettest_bsd.c	2008-02-02 01:27:13 UTC (rev 208)
@@ -1278,11 +1278,11 @@
 		     TCP_CORK,
 		     (char *)&one,
 		     sizeof(one)) == SOCKET_ERROR) {
-	perror("netperf: sendfile_tcp_stream: tcp_cork");
+	perror("netperf: create_data_socket: tcp_cork");
 	exit(1);
       }
       if (debug) {
-	fprintf(where,"sendfile_tcp_stream: tcp_cork...\n");
+	fprintf(where,"create_data_socket: tcp_cork...\n");
       }
     }
     
@@ -1294,7 +1294,12 @@
      (INADDR_ANY etc). raj 2004-07-20 */
 
   if (setsockopt(temp_socket,
+#ifdef IPPROTO_DCCP
+		 /* it is REALLY SILLY THAT THIS SHOULD BE NEEDED!! */
+		 (res->ai_protocol == IPPROTO_DCCP) ? SOL_DCCP : SOL_SOCKET,
+#else
 		 SOL_SOCKET,
+#endif
 		 SO_REUSEADDR,
 		 (const char *)&on,
 		 sizeof(on)) < 0) {



More information about the netperf-dev mailing list