netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Vladimir Nikishkin <vladimir@nikishkin.pw>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com,
	eng.alaamohamedsoliman.am@gmail.com, gnault@redhat.com,
	razor@blackwall.org, idosch@nvidia.com, eyal.birger@gmail.com,
	jtoppins@redhat.com
Subject: Re: [PATCH iproute2-next v1 1/1 v1] ip-link: add support for nolocalbypass in vxlan
Date: Wed, 5 Apr 2023 17:15:02 +0800	[thread overview]
Message-ID: <ZC08FhWsRHSGr6Dk@Laptop-X1> (raw)
In-Reply-To: <87ileavr4c.fsf@laptop.lockywolf.net>

On Wed, Apr 05, 2023 at 01:21:17PM +0800, Vladimir Nikishkin wrote:
> > There is no need to include the uapi header. Stephen will sync it with upstream.
> >
> > Hi Stephen, should we add this note to the README.devel?
> >
> 
> Without this change, my code does not compile. I ended up modifying the
> header, but not adding it to git. Is this the correct way of doing it?

Yes, that's what I did.

> 
> >> diff --git a/ip/iplink_vxlan.c b/ip/iplink_vxlan.c
> >> index c7e0e1c4..17fa5cf7 100644
> >> --- a/ip/iplink_vxlan.c
> >> +++ b/ip/iplink_vxlan.c
> >> @@ -276,6 +276,12 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
> >>  		} else if (!matches(*argv, "noudpcsum")) {
> >>  			check_duparg(&attrs, IFLA_VXLAN_UDP_CSUM, *argv, *argv);
> >>  			addattr8(n, 1024, IFLA_VXLAN_UDP_CSUM, 0);
> >> +		} else if (!matches(*argv, "localbypass")) {
> >> +			check_duparg(&attrs, IFLA_VXLAN_LOCALBYPASS, *argv, *argv);
> >> +			addattr8(n, 1024, IFLA_VXLAN_LOCALBYPASS, 1);
> >> +		} else if (!matches(*argv, "nolocalbypass")) {
> >> +			check_duparg(&attrs, IFLA_VXLAN_LOCALBYPASS, *argv, *argv);
> >> +			addattr8(n, 1024, IFLA_VXLAN_LOCALBYPASS, 0);
> >
> > matches is deparated, please use strcmp instead.
> 
> Why is strcmp recommended, not strncmp? I remember strcmp being frowned
> upon for some potential memory bounds violations.

We can't limit the string length as the parameter may have same prefix. e.g.
when you have 2 parameters "beef" and "beefsalad".

Hangbin

      reply	other threads:[~2023-04-05  9:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23  6:04 [PATCH iproute2-next v1 1/1 v1] ip-link: add support for nolocalbypass in vxlan Vladimir Nikishkin
2023-03-24  1:38 ` Hangbin Liu
2023-04-05  5:21   ` Vladimir Nikishkin
2023-04-05  9:15     ` Hangbin Liu [this message]

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=ZC08FhWsRHSGr6Dk@Laptop-X1 \
    --to=liuhangbin@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eng.alaamohamedsoliman.am@gmail.com \
    --cc=eyal.birger@gmail.com \
    --cc=gnault@redhat.com \
    --cc=idosch@nvidia.com \
    --cc=jtoppins@redhat.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=vladimir@nikishkin.pw \
    /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).