Subject: Re: [PATCH iproute2 1/1] actions: Add support for user cookies

From: Stephen Hemminger <[email-masked]>
Date: Tue, 21 Mar 2017 14:22:02 -0700

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.