Commit 14a1c164 authored by Vijay Subramanian's avatar Vijay Subramanian Committed by Stephen Hemminger

netem: Fail cleanly if user input is wrong

(Resending patch since it looks like my earlier mail did not make it to
netdev).

netem reordering requires that the delay parameter be given. Currently, if no
delay is given, tc prints the error message but still installs the qdisc. Fix
this by printing the usage and failing cleanly.
Signed-off-by: default avatarVijay Subramanian <subramanian.vijay@gmail.com>
parent fdeae171
......@@ -426,6 +426,8 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv,
if (reorder.probability) {
if (opt.latency == 0) {
fprintf(stderr, "reordering not possible without specifying some delay\n");
explain();
return -1;
}
if (opt.gap == 0)
opt.gap = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment