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

raj at netperf.org raj at netperf.org
Mon Feb 4 16:16:02 PST 2008


Author: raj
Date: 2008-02-04 16:16:01 -0800 (Mon, 04 Feb 2008)
New Revision: 215

Modified:
   trunk/src/netsh.h
   trunk/src/nettest_omni.c
Log:
better default setting for direction and less annoying warning when WANT_DCCP

Modified: trunk/src/netsh.h
===================================================================
--- trunk/src/netsh.h	2008-02-04 23:58:49 UTC (rev 214)
+++ trunk/src/netsh.h	2008-02-05 00:16:01 UTC (rev 215)
@@ -36,23 +36,26 @@
 #ifdef WANT_DCCP
 
 #ifndef SOCK_DCCP
-#warning This platform has no SOCK_DCCP define, using 6
+#define DCCP_WARNING
 #define SOCK_DCCP 6
 #endif
 
 #ifndef IPPROTO_DCCP
-#warning This platform has no IPPROTO_DCCP define, using 33
+#define DCCP_WARNING
 #define IPPROTO_DCCP 33  /* defined by the IANA */
 #endif
 
 #ifndef SOL_DCCP
-#warning This platform has no SOL_DCCP define, using 269
-#warning No, I've no idea why they don't just use IPPROTO_DCCP...
+#define DCCP_WARNING
 #define SOL_DCCP 269
 #endif
 
+#ifdef DCCP_WARNING
+#warning This platform is missing one of sock_dccp ipproto_dccp or sol_dccp
 #endif
 
+#endif
+
 #ifndef NETSH
 extern char		*program; /* program invocation name		*/
 extern char             *command_line;  /* how we were invoked          */

Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c	2008-02-04 23:58:49 UTC (rev 214)
+++ trunk/src/nettest_omni.c	2008-02-05 00:16:01 UTC (rev 215)
@@ -3727,7 +3727,8 @@
        the pad_time from the elapsed time on the assumption that we
        were essentially idle for pad_time and just waiting for a timer
        to expire on something like a UDP test.  if we have not padded
-       the timer, pad_time will be zero */
+       the timer, pad_time will be zero.  if we have not timed out
+       then we want to make sure we stop the timer. */
     if (timed_out) {
       if (debug) {
 	fprintf(where,"Adjusting elapsed_time by %d seconds\n",pad_time);
@@ -3735,6 +3736,9 @@
       }
       elapsed_time -= (float)pad_time;
     }
+    else {
+      stop_timer();
+    }
 
     if (!no_control) {
       /* Get the statistics from the remote end. The remote will have
@@ -4631,9 +4635,10 @@
   protocol = IPPROTO_TCP;
 #endif
 
-  /* default to direction being NETPERF_XMIT. I wonder if I should be
-     setting this here, or checking after argument scanning... */
-  direction = NETPERF_XMIT;
+  /* we will check to see if this needs to remain 0 or set to
+     something else when we get finished scanning all the argument
+     values */
+  direction = 0;
 
   /* default is to be a stream test, so req_size and rsp_size should
      be < 0)  */
@@ -4879,6 +4884,9 @@
 
   socket_type_str = hst_to_str(socket_type);
   protocol_str = protocol_to_str(protocol);
+  /* ok, if we have gone through all that, and direction is still
+     zero, let us see if it needs to be set to something else. */
+  if ((0 == direction) && (!connection_test)) direction = NETPERF_XMIT;
   direction_str = direction_to_str(direction);
   /* some other sanity checks we need to make would include stuff when
      the user has set -m and -M such that both XMIT and RECV are set



More information about the netperf-dev mailing list