From eb284a1f8f10d752285a0a59e75bc54acae50779 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Wed, 9 Oct 2019 13:33:19 +0200 Subject: ip: functional interface to ip fragmentation This provides a functional interface to IP fragmentation. Allowing external features to fragment. Supports arbitrary encap size, for e.g. MPLS or inner fragmentation of tunnels. This also removed dual loop in MAP that was fundamentally broken. Type: fix Signed-off-by: Ole Troan Change-Id: Ia89ecec8ee3cbe2416edbe87630fdb714898c2a8 Signed-off-by: Ole Troan --- src/vnet/ip/ip4_forward.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/vnet/ip/ip4_forward.c') diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c index 1550b313915..44a681926b3 100644 --- a/src/vnet/ip/ip4_forward.c +++ b/src/vnet/ip/ip4_forward.c @@ -2293,8 +2293,8 @@ typedef enum always_inline void ip4_mtu_check (vlib_buffer_t * b, u16 packet_len, - u16 adj_packet_bytes, bool df, u16 * next, u32 * error, - u8 is_midchain) + u16 adj_packet_bytes, bool df, u16 * next, + u8 is_midchain, u32 * error) { if (packet_len > adj_packet_bytes) { @@ -2312,8 +2312,8 @@ ip4_mtu_check (vlib_buffer_t * b, u16 packet_len, /* IP fragmentation */ ip_frag_set_vnet_buffer (b, adj_packet_bytes, (is_midchain ? - IP4_FRAG_NEXT_IP4_REWRITE_MIDCHAIN : - IP4_FRAG_NEXT_IP4_REWRITE), 0); + IP_FRAG_NEXT_IP_REWRITE_MIDCHAIN : + IP_FRAG_NEXT_IP_REWRITE), 0); *next = IP4_REWRITE_NEXT_FRAGMENT; } } @@ -2486,12 +2486,12 @@ ip4_rewrite_inline_with_gso (vlib_main_t * vm, adj0[0].rewrite_header.max_l3_packet_bytes, ip0->flags_and_fragment_offset & clib_host_to_net_u16 (IP4_HEADER_FLAG_DONT_FRAGMENT), - next + 0, &error0, is_midchain); + next + 0, is_midchain, &error0); ip4_mtu_check (b[1], ip1_len, adj1[0].rewrite_header.max_l3_packet_bytes, ip1->flags_and_fragment_offset & clib_host_to_net_u16 (IP4_HEADER_FLAG_DONT_FRAGMENT), - next + 1, &error1, is_midchain); + next + 1, is_midchain, &error1); if (is_mcast) { @@ -2660,7 +2660,7 @@ ip4_rewrite_inline_with_gso (vlib_main_t * vm, adj0[0].rewrite_header.max_l3_packet_bytes, ip0->flags_and_fragment_offset & clib_host_to_net_u16 (IP4_HEADER_FLAG_DONT_FRAGMENT), - next + 0, &error0, is_midchain); + next + 0, is_midchain, &error0); if (is_mcast) { @@ -2758,7 +2758,7 @@ ip4_rewrite_inline_with_gso (vlib_main_t * vm, adj0[0].rewrite_header.max_l3_packet_bytes, ip0->flags_and_fragment_offset & clib_host_to_net_u16 (IP4_HEADER_FLAG_DONT_FRAGMENT), - next + 0, &error0, is_midchain); + next + 0, is_midchain, &error0); if (is_mcast) { -- cgit 1.2.3-korg