aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Nemov <sergey.nemov@intel.com>2019-08-19 23:29:27 +0200
committerBruce A. Mah <bmah@es.net>2019-08-19 14:29:27 -0700
commit9c69a85088595739fe96ecdd95bedd983e818a5b (patch)
treeff8d05967ec045beb22f309bf39f9c354d5e97d5 /src
parentd0d77e951931200e49415622029e03a730129f9b (diff)
downloadiperf3-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-xsrc/iperf_api.c4
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;