Discussion:
ipv6 atomic processing diff
(too old to reply)
Loganaden Velvindron
2012-09-26 17:02:48 UTC
Permalink
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.


I based the diff on similar work done by OpenBSD.

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 16:55:39 -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);

/*


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loganaden Velvindron
2012-09-26 17:19:24 UTC
Permalink
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);

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Christos Zoulas
2012-09-27 23:10:30 UTC
Permalink
Post by Loganaden Velvindron
Also remove duplicate fragoff value calculation.
Committed.

christos


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...