summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorJuraj Sloboda <jsloboda@cisco.com>2018-10-02 11:13:53 +0200
committerFlorin Coras <florin.coras@gmail.com>2018-10-04 17:55:10 +0000
commit3048b63de968ef616baf14e1abbb6502bd4fdcbc (patch)
treec505c1cd8bfb30b073148bf4e7a4836f3e823447 /src/vnet/ip
parent6f40a8a4c5792c5c5e5c77366e98b1f10370d685 (diff)
Support reassembly for fragments coming to ip4-local node
Change-Id: I3aa4708c1c3cdda344f282d56b617677080eaaa1 Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip4_forward.c7
-rw-r--r--src/vnet/ip/ip6_forward.c1
-rw-r--r--src/vnet/ip/lookup.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c
index 3cd6d3bb2b1..69a8dbad805 100644
--- a/src/vnet/ip/ip4_forward.c
+++ b/src/vnet/ip/ip4_forward.c
@@ -1485,6 +1485,7 @@ enum ip_local_packet_type_e
{
IP_LOCAL_PACKET_TYPE_L4,
IP_LOCAL_PACKET_TYPE_NAT,
+ IP_LOCAL_PACKET_TYPE_FRAG,
};
/**
@@ -1498,6 +1499,11 @@ ip4_local_classify (vlib_buffer_t * b, ip4_header_t * ip, u16 * next)
{
ip_lookup_main_t *lm = &ip4_main.lookup_main;
+ if (PREDICT_FALSE (ip4_is_fragment (ip)))
+ {
+ *next = IP_LOCAL_NEXT_REASSEMBLY;
+ return IP_LOCAL_PACKET_TYPE_FRAG;
+ }
if (PREDICT_FALSE (b->flags & VNET_BUFFER_F_IS_NATED))
{
*next = lm->local_next_by_ip_protocol[ip->protocol];
@@ -1644,6 +1650,7 @@ VLIB_REGISTER_NODE (ip4_local_node) =
[IP_LOCAL_NEXT_PUNT] = "ip4-punt",
[IP_LOCAL_NEXT_UDP_LOOKUP] = "ip4-udp-lookup",
[IP_LOCAL_NEXT_ICMP] = "ip4-icmp-input",
+ [IP_LOCAL_NEXT_REASSEMBLY] = "ip4-reassembly",
},
};
/* *INDENT-ON* */
diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c
index e05792fe28f..00af2822ac4 100644
--- a/src/vnet/ip/ip6_forward.c
+++ b/src/vnet/ip/ip6_forward.c
@@ -1389,6 +1389,7 @@ VLIB_REGISTER_NODE (ip6_local_node, static) =
[IP_LOCAL_NEXT_PUNT] = "ip6-punt",
[IP_LOCAL_NEXT_UDP_LOOKUP] = "ip6-udp-lookup",
[IP_LOCAL_NEXT_ICMP] = "ip6-icmp-input",
+ [IP_LOCAL_NEXT_REASSEMBLY] = "ip6-reassembly",
},
};
/* *INDENT-ON* */
diff --git a/src/vnet/ip/lookup.h b/src/vnet/ip/lookup.h
index e16fa0757a0..93e1e029b41 100644
--- a/src/vnet/ip/lookup.h
+++ b/src/vnet/ip/lookup.h
@@ -111,6 +111,7 @@ typedef enum
IP_LOCAL_NEXT_PUNT,
IP_LOCAL_NEXT_UDP_LOOKUP,
IP_LOCAL_NEXT_ICMP,
+ IP_LOCAL_NEXT_REASSEMBLY,
IP_LOCAL_N_NEXT,
} ip_local_next_t;