summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2012-07-08 15:30:24 +0000
committerbz <bz@FreeBSD.org>2012-07-08 15:30:24 +0000
commit1c7f26864eed0055783cdf3bd8811513c14eb99d (patch)
tree59a19dcdc8709ac987f46949569c98b849b9f54e /sys/netinet6
parent5e414b43f77a610bcd1c755841fc474d86974b6c (diff)
downloadFreeBSD-src-1c7f26864eed0055783cdf3bd8811513c14eb99d.zip
FreeBSD-src-1c7f26864eed0055783cdf3bd8811513c14eb99d.tar.gz
Implement handling of "atomic fragements" as outlined in
draft-gont-6man-ipv6-atomic-fragments to mitigate one class of possible fragmentation-based attacks. MFC after: 5 days
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/frag6.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c
index 1523133..b2e8e04 100644
--- a/sys/netinet6/frag6.c
+++ b/sys/netinet6/frag6.c
@@ -221,6 +221,19 @@ frag6_input(struct mbuf **mp, int *offp, int proto)
/* offset now points to data portion */
offset += sizeof(struct ip6_frag);
+ /*
+ * XXX-BZ RFC XXXX (draft-gont-6man-ipv6-atomic-fragments)
+ * Handle "atomic" fragments (offset and m bit set to 0) upfront,
+ * unrelated to any reassembly. Just skip the fragment header.
+ */
+ if ((ip6f->ip6f_offlg & ~IP6F_RESERVED_MASK) == 0) {
+ /* XXX-BZ we want dedicated counters for this. */
+ V_ip6stat.ip6s_reassembled++;
+ in6_ifstat_inc(dstifp, ifs6_reass_ok);
+ *offp = offset;
+ return (ip6f->ip6f_nxt);
+ }
+
IP6Q_LOCK();
/*
OpenPOWER on IntegriCloud