summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZhiyong Yang <zhiyong.yang@intel.com>2019-06-25 22:41:55 -0400
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-09-21 08:27:10 +0000
commit61d9c6bfdf8e418a98f0b162d41db97e82cc5a23 (patch)
treedb12a246a4a88134df9864cb54c21b93f64a7db2 /src
parentfb53022e583d19779667060da601f8efe95f0992 (diff)
ip: leverage existing vlib_buffer_advance
The function ip4_rewrite_inline_with_gso can leverage the existing vlib_buffer_advance to simplify code. Type: fix Change-Id: I25d943dc78aba2f67654385cf3f693eb01e0210e Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> (cherry picked from commit a6659214aa7be7fe9fa04fbdc744affaaa8324ec)
Diffstat (limited to 'src')
-rw-r--r--src/vnet/ip/ip4_forward.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index 21fe8c06d81..ecb35955798 100644
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -2517,8 +2517,7 @@ ip4_rewrite_inline_with_gso (vlib_main_t * vm,
if (PREDICT_TRUE (error0 == IP4_ERROR_NONE))
{
u32 next_index = adj0[0].rewrite_header.next_index;
- b[0]->current_data -= rw_len0;
- b[0]->current_length += rw_len0;
+ vlib_buffer_advance (b[0], -(word) rw_len0);
tx_sw_if_index0 = adj0[0].rewrite_header.sw_if_index;
vnet_buffer (b[0])->sw_if_index[VLIB_TX] = tx_sw_if_index0;
@@ -2535,8 +2534,7 @@ ip4_rewrite_inline_with_gso (vlib_main_t * vm,
if (PREDICT_TRUE (error1 == IP4_ERROR_NONE))
{
u32 next_index = adj1[0].rewrite_header.next_index;
- b[1]->current_data -= rw_len1;
- b[1]->current_length += rw_len1;
+ vlib_buffer_advance (b[1], -(word) rw_len1);
tx_sw_if_index1 = adj1[0].rewrite_header.sw_if_index;
vnet_buffer (b[1])->sw_if_index[VLIB_TX] = tx_sw_if_index1;
@@ -2653,8 +2651,7 @@ ip4_rewrite_inline_with_gso (vlib_main_t * vm,
if (PREDICT_TRUE (error0 == IP4_ERROR_NONE))
{
u32 next_index = adj0[0].rewrite_header.next_index;
- b[0]->current_data -= rw_len0;
- b[0]->current_length += rw_len0;
+ vlib_buffer_advance (b[0], -(word) rw_len0);
tx_sw_if_index0 = adj0[0].rewrite_header.sw_if_index;
vnet_buffer (b[0])->sw_if_index[VLIB_TX] = tx_sw_if_index0;