odp-util: Make sure vlan tci mask has exact match for VLAN_CFI.
authorAlex Wang <alexw@nicira.com>
Sun, 7 Jun 2015 18:38:52 +0000 (11:38 -0700)
committerAlex Wang <alexw@nicira.com>
Sun, 7 Jun 2015 18:43:34 +0000 (11:43 -0700)
commitf171fa88765ea7730f45cabdb5a4f31b7414c97a
treee3b520db160b58bfdafbc4c88795de8456563d4f
parentd6943394576b1cfc69929dbde2513617a46a4e10
odp-util: Make sure vlan tci mask has exact match for VLAN_CFI.

OVS datapath has check which prevents the installation of flow
that matches VLAN TCI but does not have exact match for VLAN_CFI
bit.  To follow this rule, ovs userspace must make sure the
flow key for datapath flow matching VLAN TCI has exact match for
VLAN_CFI bit.

Before this commit, this is not enforced, so OpenFlow flow like
"vlan_tci=0x000a/0x0fff,action=output:local" can generate datapath
flow like "vlan(vid=10/0xfff,pcp=0/0x0,cfi=1/0)".

With the OVS datapath check, the installation of such datapath
flow will be rejected with:
"|WARN|system@ovs-system: failed to put[create][modify] (Invalid argument)"

This commit makes ovs userspace always exact match the VLAN_CFI
bit if the flow matches VLAN TCI.

Reported-by: Ronald Lee <ronaldlee@vmware.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
ofproto/ofproto-dpif-xlate.c
tests/ofproto-dpif.at