Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1624411
| From | Roopa Prabhu <roopa@cumulusnetworks.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH net-next v2 4/6] vxlan: check valid combinations of address scopes |
| Date | 2017-04-16 19:20 +0200 |
| Message-ID | <twW09-6lU-3@gated-at.bofh.it> (permalink) |
| References | <twcA1-3pr-3@gated-at.bofh.it> <twcA2-3pr-13@gated-at.bofh.it> <twdmq-3Wz-15@gated-at.bofh.it> <twTYm-5aC-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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@universe-factory.net> 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"
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll 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