From a11832fe134bb5923ddd2b3816b0967234bd8e6e Mon Sep 17 00:00:00 2001 From: Eyal Bari Date: Wed, 21 Jun 2017 15:32:13 +0300 Subject: VNET:explicitly pad l2_classify Change-Id: I77412aa8c17b45b1533604e7bfe8fe052ed0f80a Signed-off-by: Eyal Bari --- src/vnet/buffer.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h index 795bbd9610b..9aba34da930 100644 --- a/src/vnet/buffer.h +++ b/src/vnet/buffer.h @@ -170,7 +170,7 @@ typedef struct } swt; /* l2 bridging path, only valid there */ - struct + struct opaque_l2 { u32 feature_bitmap; u16 bd_index; /* bridge-domain index */ @@ -195,8 +195,7 @@ typedef struct /* L2 classify */ struct { - u64 pad; /* paddind for l2 */ - u16 pad1; + struct opaque_l2 pad; union { u32 table_index; @@ -297,14 +296,9 @@ typedef struct * The opaque field of the vlib_buffer_t is intepreted as a * vnet_buffer_opaque_t. Hence it should be big enough to accommodate one. */ -STATIC_ASSERT (sizeof (vnet_buffer_opaque_t) <= STRUCT_SIZE_OF (vlib_buffer_t, - opaque), +STATIC_ASSERT (sizeof (vnet_buffer_opaque_t) <= + STRUCT_SIZE_OF (vlib_buffer_t, opaque), "VNET buffer meta-data too large for vlib_buffer"); -STATIC_ASSERT (STRUCT_OFFSET_OF - (vnet_buffer_opaque_t, - l2_classify.table_index) >= - STRUCT_SIZE_OF (vnet_buffer_opaque_t, l2), - "l2_classify padding smaller than l2"); #define vnet_buffer(b) ((vnet_buffer_opaque_t *) (b)->opaque) -- cgit 1.2.3-korg