odp-util: Correctly generate wildcards when formating nested attributes.
authorJesse Gross <jesse@nicira.com>
Wed, 20 May 2015 18:57:35 +0000 (11:57 -0700)
committerJesse Gross <jesse@nicira.com>
Fri, 29 May 2015 01:34:21 +0000 (18:34 -0700)
commit6b8da9e92269f59537b9e3e39d5749b64220e04d
treed21ce733cdf0e7e49a801b6e5cea590d82d97600
parent58b11928efb7de6fc8356e05dcf17fe9851bb90f
odp-util: Correctly generate wildcards when formating nested attributes.

When formatting netlink attributes if no mask is present a wildcarded
attribute is synthesized for the purposes of later processing. In
the case of nested attributes this must be done recursively, filling
in the correct attributes at each level rather than just generating
a set of zeros of the correct size. This is done already but it
always uses the attribute type for the top level keys - this corresponds
to nested ENCAP attributes. However, we have several levels of potentially
nested attributes for tunnels that each have their own types.

This uses an approach similar to the kernel where we have sets of
tables for the type of each attribute linked together by pointers.
This allows the mask generation function to automatically traverse
the nested attributes and always get the right types.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
lib/odp-util.c