summaryrefslogtreecommitdiffstats
path: root/src/vnet/ip/ip_frag.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/ip_frag.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/ip_frag.c')
-rw-r--r--src/vnet/ip/ip_frag.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vnet/ip/ip_frag.c b/src/vnet/ip/ip_frag.c
index fba25fffff7..1207ec54b49 100644
--- a/src/vnet/ip/ip_frag.c
+++ b/src/vnet/ip/ip_frag.c
@@ -85,6 +85,12 @@ ip4_frag_do_fragment (vlib_main_t * vm, u32 pi, u32 ** buffer,
return;
}
+ if (p->flags & VLIB_BUFFER_NEXT_PRESENT)
+ {
+ *error = IP_FRAG_ERROR_MALFORMED;
+ return;
+ }
+
if (ip4_is_fragment (ip4))
{
ip_frag_id = ip4->fragment_id;
@@ -342,6 +348,12 @@ ip6_frag_do_fragment (vlib_main_t * vm, u32 pi, u32 ** buffer,
return;
}
+ if (p->flags & VLIB_BUFFER_NEXT_PRESENT)
+ {
+ *error = IP_FRAG_ERROR_MALFORMED;
+ return;
+ }
+
u8 has_more;
u16 initial_offset;
if (*next_header == IP_PROTOCOL_IPV6_FRAGMENTATION)