netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2 1/1] actions: Add support for user cookies
Date: Tue, 21 Mar 2017 14:22:02 -0700	[thread overview]
Message-ID: <20170321142202.525fa06e@xeon-e3> (raw)
In-Reply-To: <1490128502-22133-1-git-send-email-jhs@emojatatu.com>

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.

  reply	other threads:[~2017-03-21 21:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 20:35 [PATCH iproute2 1/1] actions: Add support for user cookies Jamal Hadi Salim
2017-03-21 21:22 ` Stephen Hemminger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-04-22 12:36 Jamal Hadi Salim
2017-04-23 16:11 ` Stephen Hemminger
2017-04-23 17:18   ` Jamal Hadi Salim
2017-11-23 16:36 ` Jiri Pirko
2017-11-23 17:32   ` Jamal Hadi Salim
2017-11-23 17:55     ` Jiri Pirko
2017-11-23 21:09 ` Stephen Hemminger
2017-11-23 21:12 ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170321142202.525fa06e@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).