See #477 for Traceback before the fix.
Testing the same packet buffer after this fix makes dpkt to partially parse the packet (Ethernet - IP6 - ICMP6 - raw data), and not crash.
Applying IP6 to the remaining raw data raises the NeedData exception:
>>> IP6(Ethernet(pk).ip6.icmp6.data)
Traceback (most recent call last):
File "/Users/oscar/pyenvs/dpkt/dpkt/dpkt/ip6.py", line 161, in unpack
opt_type = compat_ord(self.data[index])
IndexError: index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/oscar/pyenvs/dpkt/dpkt/dpkt/dpkt.py", line 89, in __init__
self.unpack(args[0])
File "/Users/oscar/pyenvs/dpkt/dpkt/dpkt/ip6.py", line 83, in unpack
ext = EXT_HDRS_CLS[next_ext_hdr](buf)
File "/Users/oscar/pyenvs/dpkt/dpkt/dpkt/dpkt.py", line 89, in __init__
self.unpack(args[0])
File "/Users/oscar/pyenvs/dpkt/dpkt/dpkt/ip6.py", line 185, in unpack
raise dpkt.NeedData
dpkt.dpkt.NeedData
Coverage increased (+0.08%) to 89.533% when pulling 7972f590bbb4e296fc7b78fcbe914d0acd4f4772 on fix-#477 into 6815b5b47cd1b028cec432fc6124eeec1b614df1 on master.
See #477 for Traceback before the fix. Testing the same packet buffer after this fix makes dpkt to partially parse the packet (Ethernet - IP6 - ICMP6 - raw data), and not crash.
Applying IP6 to the remaining raw data raises the NeedData exception: