summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2016-08-24 18:36:03 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2016-08-25 17:50:57 +0000
commitc7493e16f5f571f8fcf08dba4071d5bc2ee7cdd0 (patch)
treeb8100500bfa27c6b7aed8cb8fcc461689cae7964
parent4fe2291bbdf67251bb42ce742d8d481b901e1d1c (diff)
Save rewrite length for post-rewrite rewind action
Change-Id: I5dd52714f8422c15bf78da19bcb63246f9d0103d Signed-off-by: Dave Barach <dave@barachs.net>
-rw-r--r--vnet/vnet/buffer.h15
-rw-r--r--vnet/vnet/ip/ip4_forward.c3
-rw-r--r--vnet/vnet/ip/ip6_forward.c3
3 files changed, 9 insertions, 12 deletions
diff --git a/vnet/vnet/buffer.h b/vnet/vnet/buffer.h
index cab716c23a8..7aaa6eed9ba 100644
--- a/vnet/vnet/buffer.h
+++ b/vnet/vnet/buffer.h
@@ -125,19 +125,10 @@ typedef struct
/* next protocol */
u32 save_protocol;
- };
-
- /* Alternate used for local TCP packets. */
- struct
- {
- u32 listener_index;
- u32 established_connection_index;
-
- u32 mini_connection_index;
-
- u32 transmit_stamp;
- } tcp;
+ /* Rewrite length */
+ u32 save_rewrite_length;
+ };
/* ICMP */
struct
diff --git a/vnet/vnet/ip/ip4_forward.c b/vnet/vnet/ip/ip4_forward.c
index dd9fce4592b..8113cd72219 100644
--- a/vnet/vnet/ip/ip4_forward.c
+++ b/vnet/vnet/ip/ip4_forward.c
@@ -2825,6 +2825,8 @@ ip4_rewrite_inline (vlib_main_t * vm,
/* Worth pipelining. No guarantee that adj0,1 are hot... */
rw_len0 = adj0[0].rewrite_header.data_bytes;
rw_len1 = adj1[0].rewrite_header.data_bytes;
+ vnet_buffer(p0)->ip.save_rewrite_length = rw_len0;
+ vnet_buffer(p1)->ip.save_rewrite_length = rw_len1;
/* Check MTU of outgoing interface. */
error0 = (vlib_buffer_length_in_chain (vm, p0) > adj0[0].rewrite_header.max_l3_packet_bytes
@@ -3006,6 +3008,7 @@ ip4_rewrite_inline (vlib_main_t * vm,
/* Update packet buffer attributes/set output interface. */
rw_len0 = adj0[0].rewrite_header.data_bytes;
+ vnet_buffer(p0)->ip.save_rewrite_length = rw_len0;
if (PREDICT_FALSE (rw_len0 > sizeof(ethernet_header_t)))
vlib_increment_combined_counter
diff --git a/vnet/vnet/ip/ip6_forward.c b/vnet/vnet/ip/ip6_forward.c
index 6ceb5741ed8..b076ed0403e 100644
--- a/vnet/vnet/ip/ip6_forward.c
+++ b/vnet/vnet/ip/ip6_forward.c
@@ -2490,6 +2490,8 @@ ip6_rewrite_inline (vlib_main_t * vm,
rw_len0 = adj0[0].rewrite_header.data_bytes;
rw_len1 = adj1[0].rewrite_header.data_bytes;
+ vnet_buffer(p0)->ip.save_rewrite_length = rw_len0;
+ vnet_buffer(p1)->ip.save_rewrite_length = rw_len1;
vlib_increment_combined_counter (&lm->adjacency_counters,
cpu_index,
@@ -2631,6 +2633,7 @@ ip6_rewrite_inline (vlib_main_t * vm,
/* Update packet buffer attributes/set output interface. */
rw_len0 = adj0[0].rewrite_header.data_bytes;
+ vnet_buffer(p0)->ip.save_rewrite_length = rw_len0;
vlib_increment_combined_counter (&lm->adjacency_counters,
cpu_index,