openvswitch: Don't validate IPv6 label masks.
authorJoe Stringer <joestringer@nicira.com>
Wed, 19 Nov 2014 21:54:49 +0000 (13:54 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Nov 2014 03:56:13 +0000 (22:56 -0500)
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>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/openvswitch/flow_netlink.c

index fa4ec2e4a78b873ba4c819aa66a82b4be3142def..089b195c064ae56445b458e52e0dcaefa90b615c 100644 (file)
@@ -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;