Bug. Rebuilding from to_dict() crashes when an IPv6 extension header was parsed by the generic IPv6_Ext fallback, which happens for example when the header is cut short. The dict path rebuilds the entry with the dedicated class (HOPOPT), which then misses the fields only it would have parsed.
Repro on main (94ae9664c):
hop = bytes([59,1]) + bytes([1,12]) + bytes(12) # HOPOPT, 16 octets declared
raw = bytes([0x60,0,0,0]) + struct.pack('!HBB', 16, 0, 64) + b'\x00'*32 + hop[:10]
p = IPv6(raw, len(raw)) # _exthdr holds an IPv6_Ext
IPv6.from_data(p.info.to_dict()) # AttributeError: 'HOPOPT' object has no attribute 'options'
Cuts at 8, 10, 12 and 15 octets all fail the same way. The object form is unaffected.
The cause is in ipv6.py's dict path, around _lookup_exthdr, which #1466 changes. Found by the #1465 worker (107 cut cases).
Bug. Rebuilding from
to_dict()crashes when an IPv6 extension header was parsed by the genericIPv6_Extfallback, which happens for example when the header is cut short. The dict path rebuilds the entry with the dedicated class (HOPOPT), which then misses the fields only it would have parsed.Repro on
main(94ae9664c):Cuts at 8, 10, 12 and 15 octets all fail the same way. The object form is unaffected.
The cause is in
ipv6.py's dict path, around_lookup_exthdr, which #1466 changes. Found by the #1465 worker (107 cut cases).