Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1624395

Re: [PATCH net-next v2 4/6] vxlan: check valid combinations of address scopes

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Matthias Schiffer <mschiffer@universe-factory.net>
Newsgroups linux.kernel
Subject Re: [PATCH net-next v2 4/6] vxlan: check valid combinations of address scopes
Date Sun, 16 Apr 2017 17:00:02 +0200
Message-ID <twTOG-4RO-3@gated-at.bofh.it> (permalink)
References <twcA1-3pr-3@gated-at.bofh.it> <twcA2-3pr-13@gated-at.bofh.it> <twdcJ-3T6-1@gated-at.bofh.it>
X-Original-To Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0
MIME-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EkaWXiH3ekGngIcIsdf2F77k0c7QVA7AT"
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 122
Organization linux.* mail to news gateway
X-Original-Cc davem@davemloft.net, jbenc@redhat.com, hannes@stressinduktion.org, pshelar@ovn.org, aduyck@mirantis.com, roopa@cumulusnetworks.com, netdev@vger.kernel.org, dev@openvswitch.org, linux-kernel@vger.kernel.org
X-Original-Date Sun, 16 Apr 2017 16:57:44 +0200
X-Original-Message-ID <dcf7f3b9-09ff-4072-9dd6-3dc33932cac1@universe-factory.net>
X-Original-References <cover.1492187126.git.mschiffer@universe-factory.net> <49cd788f13c2cd3f6a42f34c219c9511cc1f9cec.1492187126.git.mschiffer@universe-factory.net> <0dd0812f-41d7-f4d8-2b40-0ff5b4553cf5@cogentembedded.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1624395

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On 04/14/2017 07:27 PM, Sergei Shtylyov wrote:
> On 04/14/2017 07:44 PM, Matthias Schiffer wrote:
> 
>> * Multicast addresses are never valid as local address
>> * Link-local IPv6 unicast addresses may only be used as remote when the
>>   local address is link-local as well
>> * Don't allow link-local IPv6 local/remote addresses without interface
>>
>> We also store in the flags field if link-local addresses are used for the
>> follow-up patches that actually make VXLAN over link-local IPv6 work.
>>
>> Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
>> ---
>>
>> v2: was "vxlan: don't allow link-local IPv6 local/remote addresses without
>> interface" before. v2 does a lot more checks and adds the
>> VXLAN_F_IPV6_LINKLOCAL flag.
>>
>>  drivers/net/vxlan.c | 35 +++++++++++++++++++++++++++++++++++
>>  include/net/vxlan.h |  2 ++
>>  2 files changed, 37 insertions(+)
>>
>> 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");
> 
>    Maybe pr_err()?

Hmm, I mostly followed the style of the existing code, which uses pr_info
for such messages. Also, these messages can be triggered by userspace, as
they're diagnostics for the newlink/changelink operations; I'm not
convinced that their importance justifies pr_err().

Generally, it seems unusual to me to use the kernel log for configuration
diagnostics at all; just removing the messages would be another option.
Stephen also mentioned "extended netlink error reporting", but I guess that
can be done in another patchset.

Matthias

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next v2 4/6] vxlan: check valid combinations of address scopes Matthias Schiffer <mschiffer@universe-factory.net> - 2017-04-14 18:50 +0200
  Re: [PATCH net-next v2 4/6] vxlan: check valid combinations of  address scopes Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2017-04-14 19:30 +0200
    Re: [PATCH net-next v2 4/6] vxlan: check valid combinations of  address scopes Matthias Schiffer <mschiffer@universe-factory.net> - 2017-04-16 17:00 +0200
  Re: [PATCH net-next v2 4/6] vxlan: check valid combinations of  address scopes Stephen Hemminger <stephen@networkplumber.org> - 2017-04-14 19:40 +0200
    Re: [PATCH net-next v2 4/6] vxlan: check valid combinations of  address scopes Matthias Schiffer <mschiffer@universe-factory.net> - 2017-04-16 17:10 +0200
      Re: [PATCH net-next v2 4/6] vxlan: check valid combinations of address  scopes Roopa Prabhu <roopa@cumulusnetworks.com> - 2017-04-16 19:20 +0200

csiph-web