public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Roopa Prabhu <roopa-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public•gmane.org>
To: Matthias Schiffer
	<mschiffer-Nyw9WiXk/RKXhJHkyCwd5uTW4wlIGRCZ@public•gmane.org>
Cc: dev-yBygre7rU0TnMu66kgdUjQ@public•gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	jbenc-H+wXaHxf7aLQT0dZR+AlfA@public•gmane.org,
	Stephen Hemminger
	<stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public•gmane.org>,
	aduyck-nYU0QVwCCFFWk0Htik3J/w@public•gmane.org,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q@public•gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public•gmane.org
Subject: Re: [PATCH net-next v2 4/6] vxlan: check valid combinations of address scopes
Date: Sun, 16 Apr 2017 10:15:05 -0700	[thread overview]
Message-ID: <58F3A699.5070002@cumulusnetworks.com> (raw)
In-Reply-To: <d401b6c7-357a-1e1c-13bd-64e9af951971-Nyw9WiXk/RKXhJHkyCwd5uTW4wlIGRCZ@public.gmane.org>

On 4/16/17, 8:03 AM, Matthias Schiffer wrote:
> On 04/14/2017 07:36 PM, Stephen Hemminger wrote:
>> On Fri, 14 Apr 2017 18:44:44 +0200
>> Matthias Schiffer <mschiffer-Nyw9WiXk/RKXhJHkyCwd5uTW4wlIGRCZ@public•gmane.org> wrote:
>>
>>> diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
>>> index 07f89b037681..95a71546e8f2 100644
>>> --- a/drivers/net/vxlan.c
>>> +++ b/drivers/net/vxlan.c
>>> @@ -2881,11 +2881,39 @@ static int vxlan_config_validate(struct net *src_net, struct vxlan_config *conf,
>>>  	if (conf->saddr.sa.sa_family != conf->remote_ip.sa.sa_family)
>>>  		return -EINVAL;
>>>  
>>> +	if (vxlan_addr_multicast(&conf->saddr))
>>> +		return -EINVAL;
>>> +
>>>  	if (conf->saddr.sa.sa_family == AF_INET6) {
>>>  		if (!IS_ENABLED(CONFIG_IPV6))
>>>  			return -EPFNOSUPPORT;
>>>  		use_ipv6 = true;
>>>  		conf->flags |= VXLAN_F_IPV6;
>>> +
>>> +		if (!(conf->flags & VXLAN_F_COLLECT_METADATA)) {
>>> +			int local_type =
>>> +				ipv6_addr_type(&conf->saddr.sin6.sin6_addr);
>>> +			int remote_type =
>>> +				ipv6_addr_type(&conf->remote_ip.sin6.sin6_addr);
>>> +
>>> +			if (local_type & IPV6_ADDR_LINKLOCAL) {
>>> +				if (!(remote_type & IPV6_ADDR_LINKLOCAL) &&
>>> +				    (remote_type != IPV6_ADDR_ANY)) {
>>> +					pr_info("invalid combination of address scopes\n");
>> It is always helpful to include device if possible in error message.
>> 					netdev_notice(old->dev, " invalid combination of address scopes\n");
> That makes sense, I'll change it in v3.

I think it should just return -EINVAL here since this is in response to a netlink call from user-space.
I dont think we should print anything but like stephen says use the extended ack mechanism to propagate more information
about the error.


>
>> Also vxlan is good candidate for extended netlink error reporting.
> Can you point me to a piece of code that does this? Unless you insist, I
> wouldn't do it in this patchset, but I might implement the extended error
> reporting later.
>
For rtnetlink users (vxlan is one of them) this is still in the works... see patch "net: rtnetlink: plumb extended ack to doit function"

  parent reply	other threads:[~2017-04-16 17:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-14 16:44 [PATCH net-next v2 0/6] vxlan: cleanup and IPv6 link-local support Matthias Schiffer
2017-04-14 16:44 ` [PATCH net-next v2 1/6] vxlan: refactor verification and application of configuration Matthias Schiffer
2017-04-14 16:44 ` [PATCH net-next v2 2/6] vxlan: get rid of redundant vxlan_dev.flags Matthias Schiffer
2017-04-14 16:44 ` [PATCH net-next v2 3/6] vxlan: improve validation of address family configuration Matthias Schiffer
2017-04-14 16:44 ` [PATCH net-next v2 4/6] vxlan: check valid combinations of address scopes Matthias Schiffer
     [not found]   ` <49cd788f13c2cd3f6a42f34c219c9511cc1f9cec.1492187126.git.mschiffer-Nyw9WiXk/RKXhJHkyCwd5uTW4wlIGRCZ@public.gmane.org>
2017-04-14 17:27     ` Sergei Shtylyov
     [not found]       ` <0dd0812f-41d7-f4d8-2b40-0ff5b4553cf5-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2017-04-16 14:57         ` Matthias Schiffer
2017-04-14 17:36     ` Stephen Hemminger
2017-04-16 15:03       ` Matthias Schiffer
     [not found]         ` <d401b6c7-357a-1e1c-13bd-64e9af951971-Nyw9WiXk/RKXhJHkyCwd5uTW4wlIGRCZ@public.gmane.org>
2017-04-16 17:15           ` Roopa Prabhu [this message]
2017-04-14 16:44 ` [PATCH net-next v2 5/6] vxlan: fix snooping for link-local IPv6 addresses Matthias Schiffer
2017-04-14 16:44 ` [PATCH net-next v2 6/6] vxlan: allow multiple VXLANs with same VNI for IPv6 link-local addresses Matthias Schiffer
     [not found]   ` <95533e3ca4958ba2eca3efcc661713638feea220.1492187126.git.mschiffer-Nyw9WiXk/RKXhJHkyCwd5uTW4wlIGRCZ@public.gmane.org>
2017-04-14 17:38     ` Stephen Hemminger
2017-04-16 15:15       ` Matthias Schiffer
     [not found]         ` <3c054ae3-ec68-ab20-0928-81e313a53cde-Nyw9WiXk/RKXhJHkyCwd5uTW4wlIGRCZ@public.gmane.org>
2017-06-08 18:05           ` Matthias Schiffer

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=58F3A699.5070002@cumulusnetworks.com \
    --to=roopa-quqiamftcip+xzjcv9emoeeocmrvltnr@public$(echo .)gmane.org \
    --cc=aduyck-nYU0QVwCCFFWk0Htik3J/w@public$(echo .)gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public$(echo .)gmane.org \
    --cc=dev-yBygre7rU0TnMu66kgdUjQ@public$(echo .)gmane.org \
    --cc=jbenc-H+wXaHxf7aLQT0dZR+AlfA@public$(echo .)gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=mschiffer-Nyw9WiXk/RKXhJHkyCwd5uTW4wlIGRCZ@public$(echo .)gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ@public$(echo .)gmane.org \
    /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