diff options
author | Zhiyong Yang <zhiyong.yang@intel.com> | 2019-05-29 22:38:19 -0400 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-05-30 08:39:45 +0000 |
commit | 734d430f37251bc7e71d507983ee640ae1625fbe (patch) | |
tree | 0833a428be3061fa44cbdeb18fe6de9d42f8b814 /src/vnet/mpls | |
parent | fe5974bd881f52cdc3744710c3d6c20c0a25d4f0 (diff) |
mpls: leverage vlib_buffer_advance
Change-Id: I363a4444f4d296f04371acd65c702b1a1ce70913
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Diffstat (limited to 'src/vnet/mpls')
-rw-r--r-- | src/vnet/mpls/mpls_output.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/vnet/mpls/mpls_output.c b/src/vnet/mpls/mpls_output.c index 1d6546a6b3d..14018c1a38e 100644 --- a/src/vnet/mpls/mpls_output.c +++ b/src/vnet/mpls/mpls_output.c @@ -146,8 +146,7 @@ mpls_output_inline (vlib_main_t * vm, if (PREDICT_TRUE(vlib_buffer_length_in_chain (vm, p0) <= adj0[0].rewrite_header.max_l3_packet_bytes)) { - p0->current_data -= rw_len0; - p0->current_length += rw_len0; + vlib_buffer_advance(p0, -rw_len0); vnet_buffer (p0)->sw_if_index[VLIB_TX] = adj0[0].rewrite_header.sw_if_index; @@ -167,8 +166,7 @@ mpls_output_inline (vlib_main_t * vm, if (PREDICT_TRUE(vlib_buffer_length_in_chain (vm, p1) <= adj1[0].rewrite_header.max_l3_packet_bytes)) { - p1->current_data -= rw_len1; - p1->current_length += rw_len1; + vlib_buffer_advance(p1, -rw_len1); vnet_buffer (p1)->sw_if_index[VLIB_TX] = adj1[0].rewrite_header.sw_if_index; @@ -248,13 +246,12 @@ mpls_output_inline (vlib_main_t * vm, adj_index0, 1, vlib_buffer_length_in_chain (vm, p0) + rw_len0); - + /* Check MTU of outgoing interface. */ if (PREDICT_TRUE(vlib_buffer_length_in_chain (vm, p0) <= adj0[0].rewrite_header.max_l3_packet_bytes)) { - p0->current_data -= rw_len0; - p0->current_length += rw_len0; + vlib_buffer_advance(p0, -rw_len0); vnet_buffer (p0)->sw_if_index[VLIB_TX] = adj0[0].rewrite_header.sw_if_index; |