Skip to content

Fix ICMPv6 RFC4884 extension length handling. - #5222

Open
guedou wants to merge 1 commit into
secdev:masterfrom
guedou:fix-icmpv6-rfc4884-length
Open

guedou wants to merge 1 commit into
secdev:masterfrom
guedou:fix-icmpv6-rfc4884-length

Conversation

@guedou

@guedou guedou commented Oct 5, 2026

Copy link
Copy Markdown
Member

This PR fixes #4353

@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.14%. Comparing base (e2e35c0) to head (65ef3c8).

Files with missing lines Patch % Lines
scapy/layers/inet6.py 88.23% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5222   +/-   ##
=======================================
  Coverage   81.14%   81.14%           
=======================================
  Files         393      393           
  Lines       98325    98342   +17     
=======================================
+ Hits        79786    79802   +16     
- Misses      18539    18540    +1     
Files with missing lines Coverage Δ
scapy/layers/inet6.py 88.79% <88.23%> (-0.01%) ⬇️

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@guedou
guedou force-pushed the fix-icmpv6-rfc4884-length branch from 097fcb6 to 65ef3c8 Compare October 7, 2026 13:39
Comment thread scapy/layers/inet6.py
def post_build(self, p, pay):
p += pay
if (getattr(self, "ext", None) is not None and
getattr(self, "length", 0) == 0):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self.length is None rather.

Comment thread scapy/layers/inet6.py
if (getattr(self, "ext", None) is not None and
getattr(self, "length", 0) == 0):
# RFC 4884: padded original datagram length, in 64-bit words.
datagram_len = len(p) - len(raw(self.ext)) - 8

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raw is unnecessary

Comment thread scapy/layers/inet6.py
datagram_len = len(p) - len(raw(self.ext)) - 8
if datagram_len > 0:
length = datagram_len // 8
if length <= 255:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering it's build, I'd let the chb fail.

@gpotter2 gpotter2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, the rest LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICMPv6 Time Exceeded is not using length field

3 participants