Bug 2219 - SixLowPanNetDevice hangs trying to decode a IPv6 Fragment extension header
authorTommaso Pecorella <tommaso.pecorella@unifi.it>
Sat, 14 Nov 2015 23:23:35 +0100
changeset 11764 cfec4dc399f5
parent 11763 59d0e8916e1f
child 11765 308891f0a6da
Bug 2219 - SixLowPanNetDevice hangs trying to decode a IPv6 Fragment extension header
RELEASE_NOTES
src/sixlowpan/model/sixlowpan-net-device.cc
--- a/RELEASE_NOTES	Wed Nov 11 21:52:39 2015 -0800
+++ b/RELEASE_NOTES	Sat Nov 14 23:23:35 2015 +0100
@@ -52,6 +52,7 @@
 - Bug 2207 - Print node ID and time when printing routing tables
 - Bug 2206 - Split internet-apps from applications
 - Bug 2208 - Interface index based L4 protocols
+- Bug 2219 - SixLowPanNetDevice hangs trying to decode a IPv6 Fragment extension header
 
 Known issues
 ------------
--- a/src/sixlowpan/model/sixlowpan-net-device.cc	Wed Nov 11 21:52:39 2015 -0800
+++ b/src/sixlowpan/model/sixlowpan-net-device.cc	Sat Nov 14 23:23:35 2015 +0100
@@ -1406,7 +1406,7 @@
 
   uint32_t blobSize;
   uint8_t blobData[260];
-  blobSize = encoding.CopyBlob (blobData + 2, 260);
+  blobSize = encoding.CopyBlob (blobData + 2, 260-2);
   uint8_t paddingSize = 0;
 
   uint8_t actualEncodedHeaderType = encoding.GetEid ();
@@ -1525,6 +1525,10 @@
           blobData [0] = encoding.GetNextHeader ();
         }
       blobData [1] = 0;
+
+      blob.AddAtStart (blobSize + 2);
+      blob.Begin ().Write (blobData, blobSize + 2);
+
       fragHeader.Deserialize (blob.Begin ());
       packet->AddHeader (fragHeader);
       break;