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

raj at netperf.org raj at netperf.org
Wed Mar 21 15:17:00 PDT 2012


Author: raj
Date: 2012-03-21 15:17:00 -0700 (Wed, 21 Mar 2012)
New Revision: 541

Modified:
   trunk/src/nettest_bsd.c
   trunk/src/nettest_omni.c
Log:
more cleaning

Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c	2012-03-21 21:13:42 UTC (rev 540)
+++ trunk/src/nettest_bsd.c	2012-03-21 22:17:00 UTC (rev 541)
@@ -506,14 +506,12 @@
 char *
 protocol_to_str(int protocol) {
   switch(protocol) {
-#ifdef IPPROTO_TCP
+    /* ass-u-me that everyone has IPPROTO_TCP and IPPROTO_UDP */
   case IPPROTO_TCP:
     return "TCP";
-#endif
-#ifdef IPPROTO_UDP
   case IPPROTO_UDP:
     return "UDP";
-#endif
+    /* but do not assume that everyone has the others */
 #ifdef IPPROTO_UDPLITE
   case IPPROTO_UDPLITE:
     return "UDPLite";

Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c	2012-03-21 21:13:42 UTC (rev 540)
+++ trunk/src/nettest_omni.c	2012-03-21 22:17:00 UTC (rev 541)
@@ -290,7 +290,6 @@
 int was_legacy = 0;
 int legacy = 0;
 int implicit_direction = 0;
-int implicit_socket = 0;
 int explicit_data_address = 0;
 
 uint64_t      trans_completed = 0;
@@ -6510,7 +6509,6 @@
   legacy = 1;
   implicit_direction = 0;  /* do we allow certain options to
 			      implicitly affect the test direction? */
-  implicit_socket = 0;
   if (strcasecmp(test_name,"TCP_STREAM") == 0) {
     direction = NETPERF_XMIT;
   }
@@ -6551,7 +6549,6 @@
     was_legacy = 0;
     legacy = 0;
     implicit_direction = 1;
-    implicit_socket = 0;
   }
   socket_type_str = hst_to_str(socket_type);
 }
@@ -6931,13 +6928,11 @@
       break;
     case 't':
       /* set the socket type */
-      if (implicit_socket)
-	socket_type = parse_socket_type(optarg);
+      socket_type = parse_socket_type(optarg);
       break;
     case 'T':
       /* set the protocol - aka "Transport" */
-      if (implicit_socket)
-	protocol = parse_protocol(optarg);
+      protocol = parse_protocol(optarg);
       break;
     case 'u':
       /* use the supplied string as the UUID for this test. at some



More information about the netperf-dev mailing list