[ovs-dev] [RFC] ofp-actions: Remove expectation of struct ofpact size.

Gurucharan Shetty shettyg at nicira.com
Mon Mar 10 21:12:27 UTC 2014


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 expecting that this structure is less than or equal to 8 bytes
which won't be true in compilers where enums are not packed.

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
---
There must have been a reason why there was this BUILD_ASSERT in the
first place. But, I do not understand the reason. (Unit tests don't
fail after removing the OVS_PACKED_ENUM macro from the related enums
and this build assert.)
---
 lib/ofp-actions.h |    1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h
index 0f6bf70..5002fa7 100644
--- a/lib/ofp-actions.h
+++ b/lib/ofp-actions.h
@@ -439,7 +439,6 @@ 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);
 
 static inline size_t
 ofpact_nest_get_action_len(const struct ofpact_nest *on)
-- 
1.7.9.5




More information about the dev mailing list