* [PATCHv3 net] openvswitch: Don't validate IPv6 label masks.
@ 2014-11-19 21:54 Joe Stringer
2014-11-19 22:05 ` Pravin Shelar
2014-11-21 19:47 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Joe Stringer @ 2014-11-19 21:54 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel, pshelar, dev
When userspace doesn't provide a mask, OVS datapath generates a fully
unwildcarded mask for the flow by copying the flow and setting all bits
in all fields. For IPv6 label, this creates a mask that matches on the
upper 12 bits, causing the following error:
openvswitch: netlink: Invalid IPv6 flow label value (value=ffffffff, max=fffff)
This patch ignores the label validation check for masks, avoiding this
error.
Signed-off-by: Joe Stringer <joestringer@nicira.com>
---
v3: Alternative approach.
Was "openvswitch: Fix mask generation for IPv6 labels."
v2: OR lower 20 bits (upper 12 bits remain from earlier memdup)
---
net/openvswitch/flow_netlink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
index fa4ec2e..089b195 100644
--- a/net/openvswitch/flow_netlink.c
+++ b/net/openvswitch/flow_netlink.c
@@ -690,7 +690,7 @@ static int ovs_key_from_nlattrs(struct sw_flow_match *match, u64 attrs,
return -EINVAL;
}
- if (ipv6_key->ipv6_label & htonl(0xFFF00000)) {
+ if (!is_mask && ipv6_key->ipv6_label & htonl(0xFFF00000)) {
OVS_NLERR("IPv6 flow label %x is out of range (max=%x).\n",
ntohl(ipv6_key->ipv6_label), (1 << 20) - 1);
return -EINVAL;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCHv3 net] openvswitch: Don't validate IPv6 label masks.
2014-11-19 21:54 [PATCHv3 net] openvswitch: Don't validate IPv6 label masks Joe Stringer
@ 2014-11-19 22:05 ` Pravin Shelar
2014-11-21 19:47 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Pravin Shelar @ 2014-11-19 22:05 UTC (permalink / raw)
To: Joe Stringer; +Cc: netdev, LKML, dev
On Wed, Nov 19, 2014 at 1:54 PM, Joe Stringer <joestringer@nicira.com> wrote:
> When userspace doesn't provide a mask, OVS datapath generates a fully
> unwildcarded mask for the flow by copying the flow and setting all bits
> in all fields. For IPv6 label, this creates a mask that matches on the
> upper 12 bits, causing the following error:
>
> openvswitch: netlink: Invalid IPv6 flow label value (value=ffffffff, max=fffff)
>
> This patch ignores the label validation check for masks, avoiding this
> error.
>
> Signed-off-by: Joe Stringer <joestringer@nicira.com>
Thanks for the fix.
Acked-by: Pravin B Shelar <pshelar@nicira.com>
> ---
> v3: Alternative approach.
> Was "openvswitch: Fix mask generation for IPv6 labels."
> v2: OR lower 20 bits (upper 12 bits remain from earlier memdup)
> ---
> net/openvswitch/flow_netlink.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
> index fa4ec2e..089b195 100644
> --- a/net/openvswitch/flow_netlink.c
> +++ b/net/openvswitch/flow_netlink.c
> @@ -690,7 +690,7 @@ static int ovs_key_from_nlattrs(struct sw_flow_match *match, u64 attrs,
> return -EINVAL;
> }
>
> - if (ipv6_key->ipv6_label & htonl(0xFFF00000)) {
> + if (!is_mask && ipv6_key->ipv6_label & htonl(0xFFF00000)) {
> OVS_NLERR("IPv6 flow label %x is out of range (max=%x).\n",
> ntohl(ipv6_key->ipv6_label), (1 << 20) - 1);
> return -EINVAL;
> --
> 1.7.10.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCHv3 net] openvswitch: Don't validate IPv6 label masks.
2014-11-19 21:54 [PATCHv3 net] openvswitch: Don't validate IPv6 label masks Joe Stringer
2014-11-19 22:05 ` Pravin Shelar
@ 2014-11-21 19:47 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-11-21 19:47 UTC (permalink / raw)
To: joestringer; +Cc: netdev, linux-kernel, pshelar, dev
From: Joe Stringer <joestringer@nicira.com>
Date: Wed, 19 Nov 2014 13:54:49 -0800
> When userspace doesn't provide a mask, OVS datapath generates a fully
> unwildcarded mask for the flow by copying the flow and setting all bits
> in all fields. For IPv6 label, this creates a mask that matches on the
> upper 12 bits, causing the following error:
>
> openvswitch: netlink: Invalid IPv6 flow label value (value=ffffffff, max=fffff)
>
> This patch ignores the label validation check for masks, avoiding this
> error.
>
> Signed-off-by: Joe Stringer <joestringer@nicira.com>
> ---
> v3: Alternative approach.
> Was "openvswitch: Fix mask generation for IPv6 labels."
> v2: OR lower 20 bits (upper 12 bits remain from earlier memdup)
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-21 19:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-19 21:54 [PATCHv3 net] openvswitch: Don't validate IPv6 label masks Joe Stringer
2014-11-19 22:05 ` Pravin Shelar
2014-11-21 19:47 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).