[netperf-dev] netperf2 commit notice r484 - in trunk: . src

raj at netperf.org raj at netperf.org
Thu Aug 25 14:18:50 PDT 2011


Author: raj
Date: 2011-08-25 14:18:49 -0700 (Thu, 25 Aug 2011)
New Revision: 484

Modified:
   trunk/AUTHORS
   trunk/src/nettest_bsd.c
Log:
actually make the SO_PRIOIRTY call by using the correct mnemonic in the if defined check

Modified: trunk/AUTHORS
===================================================================
--- trunk/AUTHORS	2011-08-25 18:41:18 UTC (rev 483)
+++ trunk/AUTHORS	2011-08-25 21:18:49 UTC (rev 484)
@@ -266,3 +266,6 @@
 
 Masanari Iida
 Cleanups for the manual.
+
+Amir Vidai
+Patch from which changes to set SO_PRIORITY were based.
\ No newline at end of file

Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c	2011-08-25 18:41:18 UTC (rev 483)
+++ trunk/src/nettest_bsd.c	2011-08-25 21:18:49 UTC (rev 484)
@@ -1161,9 +1161,9 @@
 {
 
   SOCKET temp_socket;
-  int one;
-  int    on  = 1;
-  
+  int one = 1;
+  int on  = 1;
+  netperf_socklen_t sock_opt_len;
 
   /*set up the data socket                        */
   temp_socket = socket(res->ai_family,
@@ -1319,7 +1319,6 @@
     
   if (loc_tcpcork > 0) {
     /* the user wishes for us to set TCP_CORK on the socket */
-    int one = 1;
     if (setsockopt(temp_socket,
 		   getprotobyname("tcp")->p_proto,
 		   TCP_CORK,
@@ -1434,7 +1433,7 @@
   }
 #endif
 
-#if defined(HAS_SO_PRIORITY)
+#if defined(SO_PRIORITY)
   if (local_socket_prio > 0) {
     if (setsockopt(temp_socket,
                   SOL_SOCKET,
@@ -1447,6 +1446,14 @@
       fflush(where);
       local_socket_prio = -2;
     }
+    else {
+      sock_opt_len = 4;
+      getsockopt(temp_socket,
+		 SOL_SOCKET,
+		 SO_PRIORITY,
+		 &local_socket_prio,
+		 &sock_opt_len);	       
+    }
   }
 #endif
 



More information about the netperf-dev mailing list