summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip4_forward.c
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2018-04-10 16:02:51 +0200
committerFlorin Coras <florin.coras@gmail.com>2018-06-14 05:02:21 +0000
commit313f7e2feac232ac841ad8a9d5e21e8387514803 (patch)
tree1fe059324ed97395116e238119a0a830fcdd0ee8 /src/vnet/ip/ip4_forward.c
parentaa2f59bbd356c1165745703cfddb5ccd21e887eb (diff)
MTU: IP fragmentation added to ip4-rewrite and ip6-rewrite
Change-Id: Ibae260273f25a319153be37470aed49ff73e957a Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vnet/ip/ip4_forward.c')
-rw-r--r--src/vnet/ip/ip4_forward.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index 6d5f07bda2c..3444eb88b7c 100644
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -39,6 +39,7 @@
#include <vnet/vnet.h>
#include <vnet/ip/ip.h>
+#include <vnet/ip/ip_frag.h>
#include <vnet/ethernet/ethernet.h> /* for ethernet_header_t */
#include <vnet/ethernet/arp_packet.h> /* for ethernet_arp_header_t */
#include <vnet/ppp/ppp.h>
@@ -2013,6 +2014,8 @@ typedef enum
{
IP4_REWRITE_NEXT_DROP,
IP4_REWRITE_NEXT_ICMP_ERROR,
+ IP4_REWRITE_NEXT_FRAGMENT,
+ IP4_REWRITE_N_NEXT /* Last */
} ip4_rewrite_next_t;
/**
@@ -2042,8 +2045,10 @@ ip4_mtu_check (vlib_buffer_t * b, u16 packet_len,
}
else
{
- /* Add support for fragmentation here */
- *next = IP4_REWRITE_NEXT_DROP;
+ /* IP fragmentation */
+ ip_frag_set_vnet_buffer (b, 0, adj_packet_bytes,
+ IP4_FRAG_NEXT_IP4_LOOKUP, 0);
+ *next = IP4_REWRITE_NEXT_FRAGMENT;
}
}
}
@@ -2539,10 +2544,11 @@ VLIB_REGISTER_NODE (ip4_rewrite_node) = {
.format_trace = format_ip4_rewrite_trace,
- .n_next_nodes = 2,
+ .n_next_nodes = IP4_REWRITE_N_NEXT,
.next_nodes = {
[IP4_REWRITE_NEXT_DROP] = "ip4-drop",
[IP4_REWRITE_NEXT_ICMP_ERROR] = "ip4-icmp-error",
+ [IP4_REWRITE_NEXT_FRAGMENT] = "ip4-frag",
},
};
VLIB_NODE_FUNCTION_MULTIARCH (ip4_rewrite_node, ip4_rewrite)