scapy
scapy copied to clipboard
fix: set ICMPv6TimeExceeded length for RFC4884 extensions
Summary
- Automatically set the RFC 4884
lengthfield when buildingICMPv6TimeExceededmessages with ICMP extension headers - Pad the original datagram to at least 128 octets before the extension structure
- Dissect extensions in shorter ICMP messages when
lengthis present
Fixes #4353
Test plan
- [x] Issue reproduction:
ICMPv6TimeExceeded(ext=ICMPExtension_Header())round-trip setslength == 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
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: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.