Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756054AbdDPPD7 (ORCPT ); Sun, 16 Apr 2017 11:03:59 -0400 Received: from chaos.universe-factory.net ([37.72.148.22]:39784 "EHLO chaos.universe-factory.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755352AbdDPPD6 (ORCPT ); Sun, 16 Apr 2017 11:03:58 -0400 Subject: Re: [PATCH net-next v2 4/6] vxlan: check valid combinations of address scopes To: Stephen Hemminger 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 References: <49cd788f13c2cd3f6a42f34c219c9511cc1f9cec.1492187126.git.mschiffer@universe-factory.net> <20170414103604.61ecffa9@xeon-e3> From: Matthias Schiffer Message-ID: Date: Sun, 16 Apr 2017 17:03:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <20170414103604.61ecffa9@xeon-e3> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="VbTrHkq6VFJqm8MjCDLbKmikOxfAPlAqI" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3826 Lines: 97 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VbTrHkq6VFJqm8MjCDLbKmikOxfAPlAqI Content-Type: multipart/mixed; boundary="eLgAFfxR30hUrVmSvktLso4HpDfTCLXtN"; protected-headers="v1" From: Matthias Schiffer To: Stephen Hemminger 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 Message-ID: Subject: Re: [PATCH net-next v2 4/6] vxlan: check valid combinations of address scopes References: <49cd788f13c2cd3f6a42f34c219c9511cc1f9cec.1492187126.git.mschiffer@universe-factory.net> <20170414103604.61ecffa9@xeon-e3> In-Reply-To: <20170414103604.61ecffa9@xeon-e3> --eLgAFfxR30hUrVmSvktLso4HpDfTCLXtN Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 04/14/2017 07:36 PM, Stephen Hemminger wrote: > On Fri, 14 Apr 2017 18:44:44 +0200 > Matthias Schiffer wrote: >=20 >> 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 *s= rc_net, struct vxlan_config *conf, >> if (conf->saddr.sa.sa_family !=3D conf->remote_ip.sa.sa_family) >> return -EINVAL; >> =20 >> + if (vxlan_addr_multicast(&conf->saddr)) >> + return -EINVAL; >> + >> if (conf->saddr.sa.sa_family =3D=3D AF_INET6) { >> if (!IS_ENABLED(CONFIG_IPV6)) >> return -EPFNOSUPPORT; >> use_ipv6 =3D true; >> conf->flags |=3D VXLAN_F_IPV6; >> + >> + if (!(conf->flags & VXLAN_F_COLLECT_METADATA)) { >> + int local_type =3D >> + ipv6_addr_type(&conf->saddr.sin6.sin6_addr); >> + int remote_type =3D >> + ipv6_addr_type(&conf->remote_ip.sin6.sin6_addr); >> + >> + if (local_type & IPV6_ADDR_LINKLOCAL) { >> + if (!(remote_type & IPV6_ADDR_LINKLOCAL) && >> + (remote_type !=3D IPV6_ADDR_ANY)) { >> + pr_info("invalid combination of address scopes\n"); >=20 > 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. > 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. Matthias --eLgAFfxR30hUrVmSvktLso4HpDfTCLXtN-- --VbTrHkq6VFJqm8MjCDLbKmikOxfAPlAqI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEZmTnvaa2aYgexS51Fu8/ZMsgHZwFAljzh9kACgkQFu8/ZMsg HZxU6A//UE7kCazO+QV2Bv9n/FiuExrS94IPDH/8F3K4/UdlfdzyNG9EIyI0WuCp t4VS8kHXoSqhwdemo2RSsrDpPeSp6VMGfW2v/9YZwM3KuagR99lrmd0qR+Viw2pH GSAEoxywYC9G4Ucy9qFynZBcWD/sBDnXnRPE+qUAluqRiCFNmfljmLxzbdKLAn10 Z8vp4ukGJEqDgcdtqLLnbrpaJMCd9Y9YHm7DNDmSmn29FO/kedrh7GrKGtdNIIab ozvjwPrgnaom+QN0aflNdDogK8sosLf00qRFOpKeNdkTe5L02OAyZJT5OVg9E3d3 mi2nV4Di+2siOqJW77BNqCODwABTLyJif1DPUoCfJSzbFHNljSrH+Bp3BVtuXc+j 0wTNdAZoQLHE7Vqe7RmiStuSi+WSDivy3Zn2ws6lgcYb6wT06zM48VHam3NwXRfK mXI9Stmgp/D42tVVdlAtdGFwaZIE3KZ7X7LsLk6WvAqQuR/yfdXdNjNrN8J4s5wT bV1Qzek9LRQUSpMJcAuxpJIvsHQKqpkNNoaux3EAQRzMfNlYLa394mLFOQ97g20P NRV3uD0BnsGS7VDITM8FMTRNwxll8WPVW4KLLkcjqhdksLrFSr+lO+sqoyQnUF65 +zcb8IbSoXvxbNsqEqYXzlwJWAwdrxq2zy2CVhITuQxGDEyZw9k= =KrmP -----END PGP SIGNATURE----- --VbTrHkq6VFJqm8MjCDLbKmikOxfAPlAqI--