Make the combination of -B and -P but not --cport work

The case where we should have been binding the client sockets to
ephemeral ports at a specific address for parallel tests was broken.

Fixes #239

Submitted by:  @jfitzgibbon
This commit is contained in:
Bruce A. Mah 2015-01-14 08:40:26 -08:00
parent 20bd2a6efa
commit 6bd4e258d0

View File

@ -1,5 +1,5 @@
/*
* iperf, Copyright (c) 2014, The Regents of the University of
* iperf, Copyright (c) 2014, 2015, The Regents of the University of
* California, through Lawrence Berkeley National Laboratory (subject
* to receipt of any required approvals from the U.S. Dept. of
* Energy). All rights reserved.
@ -53,7 +53,9 @@ iperf_create_streams(struct iperf_test *test)
int orig_bind_port = test->bind_port;
for (i = 0; i < test->num_streams; ++i) {
test->bind_port = orig_bind_port + i;
test->bind_port = orig_bind_port;
if (orig_bind_port)
test->bind_port += i;
if ((s = test->protocol->connect(test)) < 0)
return -1;