Skip to content

Fix Segment Routing Pad1 TLV definition #4611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 11, 2025
Merged

Conversation

yiyuandao
Copy link
Contributor

In RFC 8754, 2.1.1.1, Pad1 is a single byte.

   0 1 2 3 4 5 6 7
  +-+-+-+-+-+-+-+-+
  |     Type      |
  +-+-+-+-+-+-+-+-+

but in the current implementation, Pad1 are three bytes, b'\x00\x01\x00'

raw(IPv6ExtHdrSegmentRoutingTLVPad1())

This PR fixed it.

Hope it can help.

 In RFC 8754, 2.1.1.1, Pad1 is a single byte.
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.04%. Comparing base (316945f) to head (1d2ada8).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4611   +/-   ##
=======================================
  Coverage   81.04%   81.04%           
=======================================
  Files         365      365           
  Lines       88983    88983           
=======================================
+ Hits        72116    72120    +4     
+ Misses      16867    16863    -4     
Files with missing lines Coverage Δ
scapy/layers/inet6.py 88.57% <100.00%> (ø)

... and 3 files with indirect coverage changes

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

@gpotter2
Copy link
Member

gpotter2 commented Dec 28, 2024

That's kinda already the case:

scapy/scapy/layers/inet6.py

Lines 768 to 770 in 53d006b

class Pad1(Packet): # IPv6 Hop-By-Hop Option
name = "Pad1"
fields_desc = [_OTypeField("otype", 0x00, _hbhopts)]

I wonder if there isn't a duplicate here

@yiyuandao
Copy link
Contributor Author

That's kinda already the case:

scapy/scapy/layers/inet6.py

Lines 768 to 770 in 53d006b

class Pad1(Packet): # IPv6 Hop-By-Hop Option
name = "Pad1"
fields_desc = [_OTypeField("otype", 0x00, _hbhopts)]

I wonder if there isn't a duplicate here

Indeed, they are identical functions.

but class Pad1 is for Destination Options and Hop-by-Hop Options.
and class IPv6ExtHdrSegmentRoutingTLVPad1 is for Segment Routing Header TLVs.

In my opinion, it appears they are distinct. I think that Pv6ExtHdrSegmentRoutingTLVPad1 ought to have a unique definition of its own.

@gpotter2 gpotter2 merged commit 3d1763c into secdev:master Jul 11, 2025
24 checks passed
@gpotter2
Copy link
Member

Thanks for the PR & sorry for the huge delay !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants