public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail•com>
To: William Tu <u9012063@gmail•com>, netdev@vger•kernel.org
Subject: Re: [PATCH v3 iproute2 net-next] erspan: add erspan version II support
Date: Tue, 19 Dec 2017 18:28:24 -0700	[thread overview]
Message-ID: <8eb4e84f-2218-0c96-ece6-2b1008f2da2f@gmail.com> (raw)
In-Reply-To: <1513732121-115044-1-git-send-email-u9012063@gmail.com>

Hi William:

On 12/19/17 6:08 PM, William Tu wrote:
> @@ -343,6 +355,26 @@ get_failed:
>  				invarg("invalid erspan index\n", *argv);
>  			if (erspan_idx & ~((1<<20) - 1) || erspan_idx == 0)
>  				invarg("erspan index must be > 0 and <= 20-bit\n", *argv);
> +		} else if (strcmp(*argv, "erspan_ver") == 0) {
> +			NEXT_ARG();
> +			if (get_u8(&erspan_ver, *argv, 0))
> +				invarg("invalid erspan version\n", *argv);
> +			if (erspan_ver != 1 && erspan_ver != 2)
> +				invarg("erspan version must be 1 or 2\n", *argv);
> +		} else if (strcmp(*argv, "erspan_dir") == 0) {
> +			NEXT_ARG();
> +			if (strcmp(*argv, "ingress") == 0 ||
> +			    strcmp(*argv, "in") == 0)
> +				erspan_dir = 0;
> +			else if (strcmp(*argv, "egress") == 0 ||
> +				 strcmp(*argv, "e") == 0)

iproute2 has a matches() function that should be used -- it basically
allows whatever shorthand notation matches -- in this case e, eg, egr,
egres, egress all match. Checkout ip/iplink.c and search for matches.

  reply	other threads:[~2017-12-20  1:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20  1:08 [PATCH v3 iproute2 net-next] erspan: add erspan version II support William Tu
2017-12-20  1:28 ` David Ahern [this message]
2017-12-20  1:51   ` William Tu

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=8eb4e84f-2218-0c96-ece6-2b1008f2da2f@gmail.com \
    --to=dsahern@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=u9012063@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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