summaryrefslogtreecommitdiffstats
path: root/src/vnet/buffer.h
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2021-10-28 10:50:47 +0200
committerDamjan Marion <dmarion@me.com>2021-11-02 22:33:32 +0000
commit6ea5c4744a132ca5f21b8cffab7676a386d6ebf5 (patch)
tree128d1109491a6eef8ecf2d1b6fae3b6e16fe74c2 /src/vnet/buffer.h
parent78b4f4e19bb60b89c5ed00a2d81b1bbfee27c3e2 (diff)
fib: allow vnet rewrite max size to be smaller the pre_data
There is no reason to enforce vnet rewrite size to be equal to pre_data. Moreover, since vnet rewrite size is now saved as u8, this limits pre_data to 192 bytes. Type: fix Fixes: 7dbf9a1a4fff5c3b20ad972289e49e3f88e82f2d Change-Id: I3f848aa905ea4a794f3b4aa62c929a481261a3f1 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/buffer.h')
-rw-r--r--src/vnet/buffer.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h
index 2b3152fbcd6..09abedd5e74 100644
--- a/src/vnet/buffer.h
+++ b/src/vnet/buffer.h
@@ -417,7 +417,9 @@ typedef struct
};
} vnet_buffer_opaque_t;
-#define VNET_REWRITE_TOTAL_BYTES (VLIB_BUFFER_PRE_DATA_SIZE)
+#define VNET_REWRITE_TOTAL_BYTES 128
+STATIC_ASSERT (VNET_REWRITE_TOTAL_BYTES <= VLIB_BUFFER_PRE_DATA_SIZE,
+ "VNET_REWRITE_TOTAL_BYTES too big");
STATIC_ASSERT (STRUCT_SIZE_OF (vnet_buffer_opaque_t, ip.save_rewrite_length)
== STRUCT_SIZE_OF (vnet_buffer_opaque_t,