Introduce single-layer and compatibility modes for UDS, KWP, OBD, GMLAN#4962
Merged
polybassa merged 1 commit intoApr 24, 2026
Merged
Conversation
… GMLAN protocols; add documentation and tests.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4962 +/- ##
==========================================
+ Coverage 80.30% 80.35% +0.04%
==========================================
Files 379 379
Lines 93164 93389 +225
==========================================
+ Hits 74820 75042 +222
- Misses 18344 18347 +3
🚀 New features to boost your workflow:
|
Contributor
Author
|
@gpotter2 Please review. |
Member
|
The code is good. You really went out of your way way to make it backwards compatible, which is nice, but maybe that wasn't necessary. Honestly if it were me I would have just made In any case, LGTM ! |
gpotter2
approved these changes
Apr 23, 2026
Contributor
Author
|
Thanks for your feedback. I wanted to have a "smooth" transition from the current way of using automotive application layer protocols to the more "scapy" way of using the protocol. |
Copilot AI
pushed a commit
to BenGardiner/scapy
that referenced
this pull request
Apr 27, 2026
… GMLAN protocols; add documentation and tests. (secdev#4962) Co-authored-by: Nils Weiss <nils.weiss@dissecto.com> Co-authored-by: BenGardiner <243321+BenGardiner@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce single-layer and compatibility modes for UDS, KWP, OBD, and GMLAN protocols; add documentation and tests.
This bothered me for a while. When I started implementing the Automotive Application Layer protocols, I've somehow split them in two parts. For example ->
UDS() / UDS_RDBI()However, if we treat this correctly, it should be just one packet
UDS_RDBI().This PR introduces a single layer mode which can be turned on optionally. Also, I've created a compatibility mode that allows to mix both "styles". The compatibility mode will silently remove the
servicefield in a subpacket. Since Scapy should be able to craft malformed packets as well, I made this compatibility mode a configuration option. So if someone wants to craft malformed packets, he can turn this mode off.Maybe some day in the future, we can turn on the single layer mode by default and flag the dual layer mode as deprecated.