[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120120112212.30c50864@nehalam.linuxnetplumber.net>
Date: Fri, 20 Jan 2012 11:22:12 -0800
From: Stephen Hemminger <shemminger@...tta.com>
To: Vijay Subramanian <subramanian.vijay@...il.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH iproute2] netem: Fail cleanly if user input is wrong
On Fri, 20 Jan 2012 09:50:25 -0800
Vijay Subramanian <subramanian.vijay@...il.com> wrote:
> (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: Vijay Subramanian <subramanian.vijay@...il.com>
> ---
> tc/q_netem.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/tc/q_netem.c b/tc/q_netem.c
> index b1fd452..23164d9 100644
> --- a/tc/q_netem.c
> +++ b/tc/q_netem.c
> @@ -395,6 +395,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;
Applied
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists