svn commit: r238517 - stable/7/sys/netinet6
Bjoern A. Zeeb
bz at FreeBSD.org
Mon Jul 16 07:22:23 UTC 2012
Author: bz
Date: Mon Jul 16 07:22:22 2012
New Revision: 238517
URL: http://svn.freebsd.org/changeset/base/238517
Log:
MFC r238248:
Implement handling of "atomic fragements" as outlined in
draft-gont-6man-ipv6-atomic-fragments to mitigate one class of
possible fragmentation-based attacks.
Modified:
stable/7/sys/netinet6/frag6.c
Directory Properties:
stable/7/sys/ (props changed)
Modified: stable/7/sys/netinet6/frag6.c
==============================================================================
--- stable/7/sys/netinet6/frag6.c Mon Jul 16 07:08:34 2012 (r238516)
+++ stable/7/sys/netinet6/frag6.c Mon Jul 16 07:22:22 2012 (r238517)
@@ -209,6 +209,19 @@ frag6_input(struct mbuf **mp, int *offp,
/* 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. */
+ ip6stat.ip6s_reassembled++;
+ in6_ifstat_inc(dstifp, ifs6_reass_ok);
+ *offp = offset;
+ return (ip6f->ip6f_nxt);
+ }
+
IP6Q_LOCK();
/*
More information about the svn-src-stable-7
mailing list