datapath: Backport "openvswitch: Fix mask generation for nested attributes."
authorJesse Gross <jesse@nicira.com>
Wed, 16 Sep 2015 04:32:15 +0000 (21:32 -0700)
committerJesse Gross <jesse@nicira.com>
Fri, 18 Sep 2015 00:12:39 +0000 (17:12 -0700)
commit6da061f4bffef15abf438d4d9dda51773dbcc18f
tree6271ef4860ebb7d0ee9e2358560abaa4fa0e3adf
parentcdd42edaa30993879ac5c567bd6a43442df5d0d1
datapath: Backport "openvswitch: Fix mask generation for nested attributes."

Upstream commit:
    openvswitch: Fix mask generation for nested attributes.

    Masks were added to OVS flows in a way that was backwards compatible
    with userspace programs that did not generate masks. As a result, it is
    possible that we may receive flows that do not have a mask and we need
    to synthesize one.

    Generating a mask requires iterating over attributes and descending into
    nested attributes. For each level we need to know the size to generate the
    correct mask. We do this with a linked table of attribute types.

    Although the logic to handle these nested attributes was there in concept,
    there are a number of bugs in practice. Examples include incomplete links
    between tables, variable length attributes being treated as nested and
    missing sanity checks.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 982b5270 ("openvswitch: Fix mask generation for nested attributes.")
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
datapath/flow_netlink.c