Skip to content

Commit

Permalink
Support IPv6.plen=None in defragment6
Browse files Browse the repository at this point in the history
  • Loading branch information
shapaz authored Jan 24, 2024
1 parent 8798cef commit 6c901ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scapy/layers/inet6.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,9 @@ def defragment6(packets):
offset = 8 * q.offset
if offset != len(fragmentable):
warning("Expected an offset of %d. Found %d. Padding with XXXX" % (len(fragmentable), offset)) # noqa: E501
frag_data_len = p[IPv6].plen - frag_hdr_len
frag_data_len = p[IPv6].plen
if frag_data_len is not None:
frag_data_len -= frag_hdr_len
fragmentable += b"X" * (offset - len(fragmentable))
fragmentable += raw(q.payload)[:frag_data_len]

Expand Down

0 comments on commit 6c901ba

Please sign in to comment.