opc_da: fix STDOBJREF IPID and Fack selack field types - #5095
Open
mmadersbacher wants to merge 1 commit into
Open
opc_da: fix STDOBJREF IPID and Fack selack field types#5095mmadersbacher wants to merge 1 commit into
mmadersbacher wants to merge 1 commit into
Conversation
Both fields passed a field class where a packet class is expected. STDOBJREF wrapped UUIDField in a PacketField, so dissection died in PacketField.m2i with "UUIDField.__init__() missing 1 required positional argument: 'default'". _make_le already special-cases UUIDField, so the field was meant to be used directly. OpcDaFack passed IntField to a PacketListField, which failed silently: selackLen=2 dissected into a single Raw covering both entries. A list of plain fields is FieldListField. AI-Assisted: yes (Claude Code)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5095 +/- ##
==========================================
+ Coverage 79.42% 80.58% +1.16%
==========================================
Files 372 390 +18
Lines 96507 96858 +351
==========================================
+ Hits 76652 78057 +1405
+ Misses 19855 18801 -1054
🚀 New features to boost your workflow:
|
polybassa
approved these changes
Aug 19, 2026
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.
Two fields pass a field class where a packet class is expected.
STDOBJREF.IPIDwrapsUUIDFieldin aPacketField, so dissection dies:_make_lealready special-casesUUIDField, so the field was meant to be used directly.STDOBJREFis little-endian only, henceFORMAT_LE.OpcDaFack.selackpassesIntFieldto aPacketListField. That one fails silently instead, withselackLen=2dissecting into a singleRawspanning both entries:A list of plain fields is
FieldListField, which gives[0xaaaaaaaa, 0xbbbbbbbb].OpcDaFackLEstill builds and dissects.Validated on Windows with Python 3.13.
UTscapy -t test/contrib/opc_da.uts -P "load_contrib('opc_da')"gives 12 passed, 0 failed. The Fack section was a# No example yetplaceholder and now holds real cases, plus one for STDOBJREF.flake8 scapy/andmypy_check.py(win32 and linux) are clean. The fullwindows.utsccampaign gives 96 failures, the same count and the same files as on master, all unrelated and caused by missing tcpdump, tshark and libpcap here.The test vectors are hand-built from the field layout, not taken from a capture.