All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Nikishkin <vladimir@nikishkin.pw>
To: Hangbin Liu <liuhangbin@gmail.com>
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, 05 Apr 2023 13:21:17 +0800	[thread overview]
Message-ID: <87ileavr4c.fsf@laptop.lockywolf.net> (raw)
In-Reply-To: <ZBz/FREYO5iho+eO@Laptop-X1>


Hangbin Liu <liuhangbin@gmail.com> writes:

> Hi Vladimir,
>
> For the subject prefix, [PATCH iproute2-next] is enough for the v1 patch.
>
> On Thu, Mar 23, 2023 at 02:04:51PM +0800, Vladimir Nikishkin wrote:
>> Add userspace support for the nolocalbypass vxlan netlink
>> attribute. With nolocalbypass, if an entry is pointing to the
>> local machine, but the system driver is not listening on this
>> port, the driver will not drop packets, but will forward them
>> to the userspace network stack instead.
>> 
>> This commit has a corresponding patch in the net-next list.
>> 
>> Signed-off-by: Vladimir Nikishkin <vladimir@nikishkin.pw>
>> ---
>>  include/uapi/linux/if_link.h |  1 +
>>  ip/iplink_vxlan.c            | 18 ++++++++++++++++++
>>  man/man8/ip-link.8.in        |  8 ++++++++
>>  3 files changed, 27 insertions(+)
>> 
>> diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
>> index d61bd32d..fd390b40 100644
>> --- a/include/uapi/linux/if_link.h
>> +++ b/include/uapi/linux/if_link.h
>> @@ -824,6 +824,7 @@ enum {
>>  	IFLA_VXLAN_TTL_INHERIT,
>>  	IFLA_VXLAN_DF,
>>  	IFLA_VXLAN_VNIFILTER, /* only applicable with COLLECT_METADATA mode */
>> +	IFLA_VXLAN_LOCALBYPASS,
>>  	__IFLA_VXLAN_MAX
>>  };
>>  #define IFLA_VXLAN_MAX	(__IFLA_VXLAN_MAX - 1)
>
> 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?

>> 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.

>
> Thanks
> Hangbin


-- 
Your sincerely,
Vladimir Nikishkin (MiEr, lockywolf)
(Laptop)
--
Fastmail.


  reply	other threads:[~2023-04-05  5:24 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 [this message]
2023-04-05  9:15     ` Hangbin Liu

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=87ileavr4c.fsf@laptop.lockywolf.net \
    --to=vladimir@nikishkin.pw \
    --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=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.