[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171123130930.6efd6291@xeon-e3>
Date: Thu, 23 Nov 2017 13:09:30 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Jamal Hadi Salim <jhs@...atatu.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH iproute2 1/1] actions: Add support for user cookies
On Sat, 22 Apr 2017 08:36:23 -0400
Jamal Hadi Salim <jhs@...atatu.com> wrote:
> +
> + if (*argv && strcmp(*argv, "cookie") == 0) {
> + size_t slen;
> +
> + NEXT_ARG();
> + slen = strlen(*argv);
> + if (slen > TC_COOKIE_MAX_SIZE * 2) {
> + char cookie_err_m[128];
> +
> + snprintf(cookie_err_m, 128,
> + "%zd Max allowed size %d",
> + slen, TC_COOKIE_MAX_SIZE*2);
> + invarg(cookie_err_m, *argv);
Don't bother going to effort of building a string for invarg(). Instead either
just print invalid cookie or use fprintf.
Also, what if kernel limits change?
Powered by blists - more mailing lists