Source-Changes-HG archive

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

[src/netbsd-6-0]: src/sys/netinet6 Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/8c943832bf4a
branches:  netbsd-6-0
changeset: 774667:8c943832bf4a
user:      riz <riz%NetBSD.org@localhost>
date:      Thu Oct 25 17:26:18 2012 +0000

description:
Pull up following revision(s) (requested by christos in ticket #637):
        sys/netinet6/frag6.c: revision 1.54
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 8aba48565bfc -r 8c943832bf4a sys/netinet6/frag6.c
--- a/sys/netinet6/frag6.c      Wed Oct 24 03:28:07 2012 +0000
+++ b/sys/netinet6/frag6.c      Thu Oct 25 17:26:18 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: frag6.c,v 1.52.2.1 2012/07/05 17:43:49 riz Exp $       */
+/*     $NetBSD: frag6.c,v 1.52.2.1.4.1 2012/10/25 17:26:18 riz 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.52.2.1 2012/07/05 17:43:49 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.52.2.1.4.1 2012/10/25 17:26:18 riz 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