android_kernel_motorola_sm6225/net/openvswitch
Pravin B Shelar f47de068f6 openvswitch: Create right mask with disabled megaflows
If megaflows are disabled, the userspace does not send the netlink attribute
OVS_FLOW_ATTR_MASK, and the kernel must create an exact match mask.

sw_flow_mask_set() sets every bytes (in 'range') of the mask to 0xff, even the
bytes that represent padding for struct sw_flow, or the bytes that represent
fields that may not be set during ovs_flow_extract().
This is a problem, because when we extract a flow from a packet,
we do not memset() anymore the struct sw_flow to 0.

This commit gets rid of sw_flow_mask_set() and introduces mask_set_nlattr(),
which operates on the netlink attributes rather than on the mask key. Using
this approach we are sure that only the bytes that the user provided in the
flow are matched.

Also, if the parse_flow_mask_nlattrs() for the mask ENCAP attribute fails, we
now return with an error.

This bug is introduced by commit 0714812134
("openvswitch: Eliminate memset() from flow_extract").

Reported-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-10-17 16:49:34 -04:00
..
actions.c openvswitch: Wrap struct ovs_key_ipv4_tunnel in a new structure. 2014-10-06 00:32:20 -04:00
datapath.c openvswitch: Add support for Geneve tunneling. 2014-10-06 00:32:21 -04:00
datapath.h openvswitch: Wrap struct ovs_key_ipv4_tunnel in a new structure. 2014-10-06 00:32:20 -04:00
dp_notify.c genetlink: make multicast groups const, prevent abuse 2013-11-19 16:39:06 -05:00
flow.c openvswitch: fix a use after free 2014-10-17 16:21:53 -04:00
flow.h openvswitch: Add support for Geneve tunneling. 2014-10-06 00:32:21 -04:00
flow_netlink.c openvswitch: Create right mask with disabled megaflows 2014-10-17 16:49:34 -04:00
flow_netlink.h openvswitch: refactor ovs flow extract API. 2014-09-15 23:28:13 -07:00
flow_table.c openvswitch: Use exact lookup for flow_get and flow_del. 2014-06-30 20:47:15 -07:00
flow_table.h openvswitch: Use exact lookup for flow_get and flow_del. 2014-06-30 20:47:15 -07:00
Kconfig openvswitch: Add support for Geneve tunneling. 2014-10-06 00:32:21 -04:00
Makefile openvswitch: Add support for Geneve tunneling. 2014-10-06 00:32:21 -04:00
vport-geneve.c openvswitch: kerneldoc warning fix 2014-10-15 23:25:33 -04:00
vport-gre.c openvswitch: Add support for Geneve tunneling. 2014-10-06 00:32:21 -04:00
vport-internal_dev.c openvswitch: Enable tunnel GSO for OVS bridge. 2014-07-24 01:15:04 -07:00
vport-internal_dev.h openvswitch: introduce rtnl ops stub 2014-07-01 14:40:17 -07:00
vport-netdev.c openvswitch: fix vport-netdev unregister 2013-10-16 14:50:22 -07:00
vport-netdev.h openvswitch: fix vport-netdev unregister 2013-10-16 14:50:22 -07:00
vport-vxlan.c openvswitch: Add support for Geneve tunneling. 2014-10-06 00:32:21 -04:00
vport.c openvswitch: use vport instead of p 2014-10-15 23:25:33 -04:00
vport.h openvswitch: Add support for Geneve tunneling. 2014-10-06 00:32:21 -04:00