From: Gurucharan Shetty Date: Wed, 12 Mar 2014 16:40:36 +0000 (-0700) Subject: ofp-actions: Relax build assertion condition for ofpact_nest struct. X-Git-Tag: sliver-openvswitch-2.2.90-1~6^2~126 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=93904c85e0a166392d67e0ce5c7cbf1937497be6;p=sliver-openvswitch.git ofp-actions: Relax build assertion condition for ofpact_nest struct. struct ofpact has enums that are packed in case of __GNUC__. This packing does not occur for visual studio. For 'struct ofpact_nest', we are currently expecting that "struct ofpact actions[]" has an offset of 8 bytes. This condition won't be true in compilers where enums are not packed. It is good enough if struct ofpact actions[] starts at an offset which is a multiple of OFPACT_ALIGNTO. Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h index 0f6bf7095..5fd318575 100644 --- a/lib/ofp-actions.h +++ b/lib/ofp-actions.h @@ -439,7 +439,7 @@ struct ofpact_nest { uint8_t pad[OFPACT_ALIGN(sizeof(struct ofpact)) - sizeof(struct ofpact)]; struct ofpact actions[]; }; -BUILD_ASSERT_DECL(offsetof(struct ofpact_nest, actions) == OFPACT_ALIGNTO); +BUILD_ASSERT_DECL(offsetof(struct ofpact_nest, actions) % OFPACT_ALIGNTO == 0); static inline size_t ofpact_nest_get_action_len(const struct ofpact_nest *on)