Output interface MTU check ignored in double-loop

In the double loop of ip4-rewrite, when forwarding packets,
the outbound interface MTU check occurs too late in the
double-loop to be actioned.

Change-Id: Ifc44e65d6ddb832aa0161d0685b1a28378541905
Signed-off-by: Chris Luke <chrisy@flirble.org>
This commit is contained in:
Chris Luke
2016-06-14 16:26:22 -04:00
committed by Dave Barach
parent 2459e4c5f5
commit f2868fcd2e

View File

@ -2641,6 +2641,15 @@ 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;
/* Check MTU of outgoing interface. */
error0 = (vlib_buffer_length_in_chain (vm, p0) > adj0[0].rewrite_header.max_l3_packet_bytes
? IP4_ERROR_MTU_EXCEEDED
: error0);
error1 = (vlib_buffer_length_in_chain (vm, p1) > adj1[0].rewrite_header.max_l3_packet_bytes
? IP4_ERROR_MTU_EXCEEDED
: error1);
next0 = (error0 == IP4_ERROR_NONE)
? adj0[0].rewrite_header.next_index : 0;
@ -2670,14 +2679,6 @@ ip4_rewrite_inline (vlib_main_t * vm,
/* packet increment */ 0,
/* byte increment */ rw_len1-sizeof(ethernet_header_t));
/* Check MTU of outgoing interface. */
error0 = (vlib_buffer_length_in_chain (vm, p0) > adj0[0].rewrite_header.max_l3_packet_bytes
? IP4_ERROR_MTU_EXCEEDED
: error0);
error1 = (vlib_buffer_length_in_chain (vm, p1) > adj1[0].rewrite_header.max_l3_packet_bytes
? IP4_ERROR_MTU_EXCEEDED
: error1);
p0->current_data -= rw_len0;
p1->current_data -= rw_len1;