Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet6 Loganaden Velvindron:



details:   https://anonhg.NetBSD.org/src/rev/c4f846b17451
branches:  trunk
changeset: 781759:c4f846b17451
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Sep 27 23:10:00 2012 +0000

description:
Loganaden Velvindron:

>From "http://tools.ietf.org/html/draft-ietf-6man-ipv6-atomic-fragments-00":

A host that receives an IPv6 packet which includes a Fragment
Header with the "Fragment Offset" equal to 0 and the "M" bit equal
to 0 MUST process such packet in isolation from any other packets/
fragments, even if such packets/fragments contain the same set
{IPV6 Source Address, IPv6 Destination Address, Fragment
Identification}.  That is, the Fragment Header of "atomic
fragments" should be removed by the receiving host, and the
resulting packet should be processed as a non-fragmented IPv6
datagram.  Additionally, any fragments already queued with the
same set {IPV6 Source Address, IPv6 Destination Address, Fragment
Identification} should not be discarded upon receipt of the
"colliding" IPv6 atomic fragment, since IPv6 atomic fragments do
not really interfere with "normal" fragmented traffic.

diffstat:

 sys/netinet6/frag6.c |  20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diffs (48 lines):

diff -r c2b39bc34a7e -r c4f846b17451 sys/netinet6/frag6.c
--- a/sys/netinet6/frag6.c      Thu Sep 27 21:51:12 2012 +0000
+++ b/sys/netinet6/frag6.c      Thu Sep 27 23:10:00 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: frag6.c,v 1.53 2012/07/01 22:04:44 rmind Exp $ */
+/*     $NetBSD: frag6.c,v 1.54 2012/09/27 23:10:00 christos Exp $      */
 /*     $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $  */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.53 2012/07/01 22:04:44 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.54 2012/09/27 23:10:00 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -171,6 +171,20 @@
        /* offset now points to data portion */
        offset += sizeof(struct ip6_frag);
 
+       /*
+        * draft-gont-6man-ipv6-atomic-fragments-00:  A host that receives an
+        * IPv6 packet which includes a Fragment Header with the "Fragment
+        * Offset" equal to 0 and the "M" bit equal to 0 MUST process such
+        * packet in isolation from any other packets/fragments.
+        */
+       fragoff = ntohs(ip6f->ip6f_offlg & IP6F_OFF_MASK);
+       if (fragoff == 0 && !(ip6f->ip6f_offlg & IP6F_MORE_FRAG)) {
+               IP6_STATINC(IP6_STAT_REASSEMBLED);
+               in6_ifstat_inc(dstifp, ifs6_reass_ok);
+               *offp = offset;
+               return ip6f->ip6f_nxt;          
+       }
+
        mutex_enter(&frag6_lock);
 
        /*
@@ -233,7 +247,7 @@
         * If it's the 1st fragment, record the length of the
         * unfragmentable part and the next header of the fragment header.
         */
-       fragoff = ntohs(ip6f->ip6f_offlg & IP6F_OFF_MASK);
+
        if (fragoff == 0) {
                q6->ip6q_unfrglen = offset - sizeof(struct ip6_hdr) -
                    sizeof(struct ip6_frag);



Home | Main Index | Thread Index | Old Index