-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix in KNXnet/IP layer (KNX addresses handling) #4663
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR. Could you fix the flake8 issues at https://github.com/secdev/scapy/actions/runs/13262979518/job/37023594039?pr=4663 ? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4663 +/- ##
==========================================
+ Coverage 81.55% 82.14% +0.59%
==========================================
Files 359 361 +2
Lines 86557 86820 +263
==========================================
+ Hits 70592 71321 +729
+ Misses 15965 15499 -466
🚀 New features to boost your workflow:
|
Done, it should be ok now! Sorry for the delay. |
if self.structure_length is None: | ||
p = struct.pack("!B", len(p)) + p[1:] | ||
p = (len(p)).to_bytes(1, byteorder='big') + p[1:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why those changes?
I think I disagree.
if self.structure_length is None: | ||
p = struct.pack("!B", len(p)) + p[1:] | ||
p = (len(p)).to_bytes(1, byteorder='big') + p[1:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
if self.structure_length is None: | ||
p = struct.pack("!B", len(p)) + p[1:] | ||
p = (len(p)).to_bytes(1, byteorder='big') + p[1:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same (and in all following post_build)
This PR introduces a few changes to the KNXnet/IP layer, last updated in 2021:
I made the PR mainly to fix issues when building packets containing individual address (format 1.1.1) or group address (format 1/1/1) fields. The layer only supported either individual address or group address in a field, but some fields (for instance, in cEMI blocks) can take both formats. For instance, the code below used to raise a ValueError and is now valid.