Open PatrikMosko opened 4 years ago
Thanks for the patch! This looks like it'll do the right thing, although I haven't actually tried compiling or running it yet.
Now that I'm staring at this, I'm trying to figure out how to recreate your problem. If you compile iperf3 where there's no SCTP support, then the command-line options for SCTP aren't compiled in (see iperf_parse_arguments()
at around line 838 in iperf_api.c
). So assuming you run on the same system, it shouldn't allow the user to specify --sctp
, --numstreams
, or -X
/--xbind
. It's true that (in the current code) the code that handles those command-line arguments is there, but they cann't get called because those options weren't included in the getopt_long()
.
If you compile on an SCTP-aware machine, everything will be activated, but if you then take the executable to a non-SCTP machine (same OS and architecture), it should try to run but will probably barf when it goes to open the data sockets.
So I'm trying to understand how you got an instance of iperf3 that's behaving the way you described. More details to help me reproduce the problem would be greatly appreciated.
Also you mentioned --without-sctp
, which would be a great configure-time parameter, except our configure script doesn't support that. (There probably should be a way to disable SCTP support explicitly, but we don't have one.)
Context
Version of iperf3: iperf3-3.7
Hardware: Lenovo ThinkPad T470S
Operating system (and distribution, if any): Fedora 31
Other relevant information (for example, non-default compilers, libraries, cross-compiling, etc.): uname: Linux gdpr 5.5.13-200.fc31.x86_64 #1 SMP Wed Mar 25 21:55:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Bug Report
Put the options tied-to SCTP functionality to the SCTP support. Options --nstreams and --xbind are present and can be invoked even when iperf3 is compiled without SCTP support, which may be missleading for someone. This is not exactly an issue or regression but I saw it, didn't liked it, so here we are.
Expected Behavior (--without-sctp): $iperf3 -c --nstreams iperf3: unrecognized option '--nstreams'
Actual Behavior iperf3 would run normally, --nstreams is ignored
Possible Solution
i_errno = IEUNIMP;
return -1; +#endif / HAVE_SCTP / case 'Z': if (!has_sendfile()) { i_errno = IENOSENDFILE;
note: proposed patch may be just first step to bound those options to SCTP, dunno.