From 7a1e9cfb7fd88a30316270dcd1f01965e199ba14 Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Sat, 14 Nov 2015 23:23:35 +0100 Subject: [PATCH] Bug 2219 - SixLowPanNetDevice hangs trying to decode a IPv6 Fragment extension header --- RELEASE_NOTES | 1 + src/sixlowpan/model/sixlowpan-net-device.cc | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 9100d5b1a..8cf286761 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -52,6 +52,7 @@ Bugs fixed - 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 ------------ diff --git a/src/sixlowpan/model/sixlowpan-net-device.cc b/src/sixlowpan/model/sixlowpan-net-device.cc index 6fa462a78..e57ed375a 100644 --- a/src/sixlowpan/model/sixlowpan-net-device.cc +++ b/src/sixlowpan/model/sixlowpan-net-device.cc @@ -1406,7 +1406,7 @@ SixLowPanNetDevice::DecompressLowPanNhc (Ptr packet, Address const &src, 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 @@ SixLowPanNetDevice::DecompressLowPanNhc (Ptr packet, Address const &src, 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;