scroot / gopacket

Automatically exported from code.google.com/p/gopacket
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

LayerContents nil for DNS layer #52

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
On DNS packet (testPacketDNSRegression in decode_test.go), I cannot obtain the 
LayerContents.  Root issue is base layer not assigned.

While fixing this bug, I have also added in unit test (in base_test.go) to 
ensure the lengths of all layers will add up to the original packet's data 
length.

Patch can be found in http://pastebin.com/FqvhsUgv

Original issue reported on code.google.com by adrian.c...@gmail.com on 4 Dec 2014 at 3:58

GoogleCodeExporter commented 9 years ago
Thanks Adrian for that patch (and this bug in my original DNS decoder).

I am not sure how Graeme want the GIT tree to be organized but I would suggest 
to split patches between the new test, and different bugs you found in some 
decoders...

Graeme ?

Original comment by laurent....@sentryo.net on 10 Dec 2014 at 3:21

GoogleCodeExporter commented 9 years ago
Will it help if I split the patch so that it is easier to merge?

Original comment by adrian.c...@gmail.com on 26 Jan 2015 at 10:55

GoogleCodeExporter commented 9 years ago
I suppose, it would be easier.
Please split per decoder + the test.
I will create a branch with all that and we'll see how it will be merge.

Thanks for your efforts to improve gopacket quality

Original comment by laurent....@gmail.com on 26 Jan 2015 at 10:59

GoogleCodeExporter commented 9 years ago
The DNS decoder fix is in http://pastebin.com/4XNLAPSn

I will try to put out the patch for other decoder + test shortly...

Original comment by adrian.c...@gmail.com on 26 Jan 2015 at 11:17

GoogleCodeExporter commented 9 years ago
The code review for the DNS fix is in 
https://code.google.com/r/adriancmtam-dns/source/detail?r=3497d9e398a91803ed24d0
06c2c030db47347e0e

Original comment by adrian.c...@gmail.com on 26 Jan 2015 at 11:24

GoogleCodeExporter commented 9 years ago
I've just committed your patch into a dedicated branch.

https://code.google.com/p/gopacket/source/detail?r=93a26530a48d5e26420779d3ee62d
b224db7fa80&name=fix-dns-jan15

Original comment by laurent....@gmail.com on 31 Jan 2015 at 5:48