scapy icon indicating copy to clipboard operation
scapy copied to clipboard

fix: set ICMPv6TimeExceeded length for RFC4884 extensions

Open T3pp31 opened this issue 5 months ago • 1 comments

Summary

  • Automatically set the RFC 4884 length field when building ICMPv6TimeExceeded messages with ICMP extension headers
  • Pad the original datagram to at least 128 octets before the extension structure
  • Dissect extensions in shorter ICMP messages when length is present

Fixes #4353

Test plan

  • [x] Issue reproduction: ICMPv6TimeExceeded(ext=ICMPExtension_Header()) round-trip sets length == 16
  • [x] Ether-wrapped round-trip from issue report
  • [x] Rebuild stability (bytes() → parse → bytes())
  • [x] Existing IPv4 ICMP extension tests (test/scapy/layers/inet.uts)
  • [x] New GH4353 tests in test/scapy/layers/inet6.uts

Made with Cursor

T3pp31 avatar Jun 21 '26 13:06 T3pp31

Codecov Report

:x: Patch coverage is 8.00000% with 23 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 47.45%. Comparing base (14cc726) to head (8b4cb43). :warning: Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
scapy/layers/inet.py 4.54% 21 Missing :warning:
scapy/layers/inet6.py 33.33% 2 Missing :warning:

:exclamation: There is a different number of reports uploaded between BASE (14cc726) and HEAD (8b4cb43). Click for more details.

HEAD has 10 uploads less than BASE
Flag BASE (14cc726) HEAD (8b4cb43)
12 2
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #5021       +/-   ##
===========================================
- Coverage   80.34%   47.45%   -32.89%     
===========================================
  Files         386      368       -18     
  Lines       96012    95672      -340     
===========================================
- Hits        77137    45405    -31732     
- Misses      18875    50267    +31392     
Files with missing lines Coverage Δ
scapy/layers/inet6.py 41.07% <33.33%> (-47.57%) :arrow_down:
scapy/layers/inet.py 25.38% <4.54%> (-46.56%) :arrow_down:

... and 337 files with indirect coverage changes

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

codecov[bot] avatar Jun 21 '26 13:06 codecov[bot]