summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Wang <alexw@nicira.com>2014-07-22 23:14:50 -0700
committerAlex Wang <alexw@nicira.com>2014-07-23 10:05:40 -0700
commit3854ab2153f943e2b2bb84520a0301424f01d4cb (patch)
tree587c2c03dc008df061a673d010b0f87f9bc84166
parentb6f4590fa036e213fcceafdcb5aa64bcf5c3e5c0 (diff)
downloadopenvswitch-3854ab2153f943e2b2bb84520a0301424f01d4cb.tar.gz
datapath: flow_netlink: Fix a bug.
Commit 62974663fe (datapath/flow_netlink: Create right mask with disabled megaflows) introduced the bug which caused ovs_nla_get_match() returns immediately after parsing the flow mask for OVS_KEY_ATTR_ENCAP. Consequently, when vlan encapsulated packets are present, the corresponding datapath flows will have incorrect mask like below. And the incorrect flows could affect other non-vlan packets. ~/ovs# ovs-dpctl dump-flows in_port(3/0xffff0000),eth_type(0x8100),encap(), packets:0, bytes:0, used:never, actions:2 This commit fixes the bug by checking and handling the return value of the parsing function correctly. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
-rw-r--r--datapath/flow_netlink.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/datapath/flow_netlink.c b/datapath/flow_netlink.c
index 5f975a1ff..445fa882a 100644
--- a/datapath/flow_netlink.c
+++ b/datapath/flow_netlink.c
@@ -938,7 +938,8 @@ int ovs_nla_get_match(struct sw_flow_match *match,
mask_attrs &= ~(1ULL << OVS_KEY_ATTR_ETHERTYPE);
encap = a[OVS_KEY_ATTR_ENCAP];
err = parse_flow_mask_nlattrs(encap, a, &mask_attrs);
- goto free_newmask;
+ if (err)
+ goto free_newmask;
} else {
OVS_NLERR("VLAN frames must have an exact match on the TPID (mask=%x).\n",
ntohs(eth_type));