VNET:explicitly pad l2_classify 52/7252/3
authorEyal Bari <ebari@cisco.com>
Wed, 21 Jun 2017 12:32:13 +0000 (15:32 +0300)
committerJohn Lo <loj@cisco.com>
Thu, 22 Jun 2017 09:14:06 +0000 (09:14 +0000)
Change-Id: I77412aa8c17b45b1533604e7bfe8fe052ed0f80a
Signed-off-by: Eyal Bari <ebari@cisco.com>
src/vnet/buffer.h

index 795bbd9..9aba34d 100644 (file)
@@ -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)