VNET:explicitly pad l2_classify
[vpp.git] / src / vnet / buffer.h
index 5d1b1c4..9aba34d 100644 (file)
@@ -170,14 +170,13 @@ typedef struct
     } swt;
 
     /* l2 bridging path, only valid there */
-    struct
+    struct opaque_l2
     {
       u32 feature_bitmap;
       u16 bd_index;            /* bridge-domain index */
       u8 l2_len;               /* ethernet header length */
       u8 shg;                  /* split-horizon group */
-      u8 bd_sn;                        /* bridge domain seq# */
-      u8 int_sn;               /* interface seq# */
+      u16 l2fib_sn;            /* l2fib bd/int seq_num */
     } l2;
 
     /* l2tpv3 softwire encap, only valid there */
@@ -196,9 +195,12 @@ typedef struct
     /* L2 classify */
     struct
     {
-      u64 pad;
-      u32 table_index;
-      u32 opaque_index;
+      struct opaque_l2 pad;
+      union
+      {
+       u32 table_index;
+       u32 opaque_index;
+      };
       u64 hash;
     } l2_classify;
 
@@ -294,8 +296,8 @@ 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");
 
 #define vnet_buffer(b) ((vnet_buffer_opaque_t *) (b)->opaque)