tech-net archive

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

Re: ipv6 atomic processing diff



Also remove duplicate fragoff value calculation.

Index: frag6.c
===================================================================
RCS file: /cvsroot/src/sys/netinet6/frag6.c,v
retrieving revision 1.52
diff -u -p -r1.52 frag6.c
--- frag6.c     31 Dec 2011 20:41:59 -0000      1.52
+++ frag6.c     26 Sep 2012 17:16:21 -0000
@@ -172,6 +172,20 @@ frag6_in(struct mbuf **mp, int *offp)
        /* 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);
 
        /*
@@ -234,7 +248,7 @@ frag6_in(struct mbuf **mp, int *offp)
         * 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