[netperf-dev] netperf2 commit notice r490 - trunk/src
raj at netperf.org
raj at netperf.org
Tue Sep 20 14:32:20 PDT 2011
Author: raj
Date: 2011-09-20 14:32:20 -0700 (Tue, 20 Sep 2011)
New Revision: 490
Modified:
trunk/src/netserver.c
trunk/src/nettest_bsd.c
trunk/src/nettest_omni.c
Log:
assorted fixes
Modified: trunk/src/netserver.c
===================================================================
--- trunk/src/netserver.c 2011-09-13 20:32:39 UTC (rev 489)
+++ trunk/src/netserver.c 2011-09-20 21:32:20 UTC (rev 490)
@@ -161,7 +161,7 @@
#ifndef DEBUG_LOG_FILE_DIR
#if defined(WIN32)
-#define DEBUG_LOG_FILE_DIR "c:\\temp\\"
+#define DEBUG_LOG_FILE_DIR ""
#elif defined(ANDROID)
#define DEBUG_LOG_FILE_DIR "/data/local/tmp/"
#else
@@ -256,7 +256,12 @@
snprintf(FileName,
sizeof(FileName),
+#if defined(WIN32)
+ "%s\\%s_%d",
+ getenv("TEMP"),
+#else
"%s_%d",
+#endif
DEBUG_LOG_FILE,
getpid());
if ((where = fopen((suppress_debug) ? NETPERF_NULL : FileName,
Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c 2011-09-13 20:32:39 UTC (rev 489)
+++ trunk/src/nettest_bsd.c 2011-09-20 21:32:20 UTC (rev 490)
@@ -1401,7 +1401,8 @@
res->ai_addrlen) < 0) {
if (debug) {
fprintf(where,
- "netperf: create_data_socket: data socket bind failed errno %d\n",
+ "netperf: create_data_socket: data socket bind failed: %s (errno %d)\n",
+ strerror(errno),
errno);
fprintf(where," port: %d\n",get_port_number(res));
fflush(where);
Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c 2011-09-13 20:32:39 UTC (rev 489)
+++ trunk/src/nettest_omni.c 2011-09-20 21:32:20 UTC (rev 490)
@@ -378,6 +378,8 @@
int was_legacy = 0;
int legacy = 0;
int implicit_direction = 0;
+int implicit_socket = 0;
+int explicit_data_address = 0;
int csv = 0;
int keyword = 0;
uint64_t trans_completed = 0;
@@ -5048,7 +5050,16 @@
nf_to_af(omni_request->ipfamily),
omni_request->netserver_ip,
&(omni_request->data_port));
-
+ /* if the user didn't explicitly set the remote data address we
+ don't want to pass along the one we picked implicitly, or a
+ netserver sitting behind a (BLETCH) NAT will be asked to try
+ to bind to the "public" IP. */
+ if (!explicit_data_address) {
+ omni_request->netserver_ip[0] = 0;
+ omni_request->netserver_ip[1] = 0;
+ omni_request->netserver_ip[2] = 0;
+ omni_request->netserver_ip[3] = 0;
+ }
if (debug > 1) {
fprintf(where,"netperf: send_omni: requesting OMNI test\n");
}
@@ -7863,6 +7874,7 @@
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;
}
@@ -7903,6 +7915,7 @@
was_legacy = 0;
legacy = 0;
implicit_direction = 1;
+ implicit_socket = 0;
}
socket_type_str = hst_to_str(socket_type);
}
@@ -8073,6 +8086,7 @@
if (arg1[0]) {
remote_data_address = malloc(strlen(arg1)+1);
strcpy(remote_data_address,arg1);
+ explicit_data_address = 1;
}
if (arg3[0]) {
remote_mask_len = convert(arg3);
@@ -8272,12 +8286,12 @@
break;
case 't':
/* set the socket type */
- if (implicit_direction)
+ if (implicit_socket)
socket_type = parse_socket_type(optarg);
break;
case 'T':
/* set the protocol - aka "Transport" */
- if (implicit_direction)
+ if (implicit_socket)
protocol = parse_protocol(optarg);
break;
case 'u':
More information about the netperf-dev
mailing list