summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorChris Luke <chrisy@flirble.org>2016-06-14 16:26:22 -0400
committerDave Barach <openvpp@barachs.net>2016-06-19 13:30:36 +0000
commitf2868fcd2e2cb237854c1ff83b52b656e9027136 (patch)
tree3f9662e99a2d2f6207197a69b00c97a0955c469a /vnet
parent2459e4c5f577907ea060957bc0699a72a1f8e1be (diff)
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>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/ip/ip4_forward.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/vnet/vnet/ip/ip4_forward.c b/vnet/vnet/ip/ip4_forward.c
index 1de0b40eb78..3075e0c3f73 100644
--- a/vnet/vnet/ip/ip4_forward.c
+++ b/vnet/vnet/ip/ip4_forward.c
@@ -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;