diff options
author | Sergey Nemov <sergey.nemov@intel.com> | 2019-08-19 23:29:27 +0200 |
---|---|---|
committer | Bruce A. Mah <bmah@es.net> | 2019-08-19 14:29:27 -0700 |
commit | 9c69a85088595739fe96ecdd95bedd983e818a5b (patch) | |
tree | ff8d05967ec045beb22f309bf39f9c354d5e97d5 /src | |
parent | d0d77e951931200e49415622029e03a730129f9b (diff) | |
download | iperf3-9c69a85088595739fe96ecdd95bedd983e818a5b.tar.gz |
fix: Fix a bug in --bidir option processing (#903)
If --bidir option was passed before --client option on command line,
the latter would override ipt->mode parameter of the test back to SENDER
or RECEIVER making the test hang during execution.
Fix this by checking if ipt->bidirectional was set to true in
iperf_set_test_role() function.
Diffstat (limited to 'src')
-rwxr-xr-x | src/iperf_api.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/iperf_api.c b/src/iperf_api.c index e1bbfa5..6319613 100755 --- a/src/iperf_api.c +++ b/src/iperf_api.c @@ -470,7 +470,9 @@ iperf_set_test_role(struct iperf_test *ipt, char role) { ipt->role = role; if (!ipt->reverse) { - if (role == 'c') + if (ipt->bidirectional) + ipt->mode = BIDIRECTIONAL; + else if (role == 'c') ipt->mode = SENDER; else if (role == 's') ipt->mode = RECEIVER; |