[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170321142202.525fa06e@xeon-e3>
Date:   Tue, 21 Mar 2017 14:22:02 -0700
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
Minor style issues.
> +			if (*argv && strcmp(*argv, "cookie") == 0) {
> +				int slen;
slen is strlen() and that returns size_t not int.
> +
> +				NEXT_ARG();
> +				slen = strlen(*argv);
> +				if (slen > (TC_COOKIE_MAX_SIZE*2))
No extra (), and space around *
> +					invarg("cookie cannot exceed %d\n",
> +					       *argv);
> +
> +				if (hex2mem(*argv, act_ck, slen/2) < 0)
Space around / operator
> +					invarg("cookie must be a hex string\n",
> +					       *argv);
> +
> +				act_ck_len = slen;
> +				argc--;
> +				argv++;
> +			}
> +
> +			if (act_ck_len)
> +				addattr_l(n, MAX_MSG, TCA_ACT_COOKIE,
> +					  (const void *)&act_ck, act_ck_len);
Cast to void *  is not necessary.
Powered by blists - more mailing lists