Fix in KNXnet/IP layer (KNX addresses handling)#4663
Fix in KNXnet/IP layer (KNX addresses handling)#4663claire-lex wants to merge 4 commits intosecdev:masterfrom
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 Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4663 +/- ##
==========================================
- Coverage 81.55% 80.87% -0.68%
==========================================
Files 359 368 +9
Lines 86557 90262 +3705
==========================================
+ Hits 70592 73002 +2410
- Misses 15965 17260 +1295
🚀 New features to boost your workflow:
|
|
Done, it should be ok now! Sorry for the delay. |
scapy/contrib/knx.py
Outdated
| 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.
Why those changes?
I think I disagree.
scapy/contrib/knx.py
Outdated
| if self.structure_length is None: | ||
| p = struct.pack("!B", len(p)) + p[1:] | ||
| p = (len(p)).to_bytes(1, byteorder='big') + p[1:] |
scapy/contrib/knx.py
Outdated
| 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.
Same (and in all following post_build)
|
Hi @claire-lex, (btw great SSTIC presentation, if I guessed the username right). Just a small bump regarding this PR. There are still a bunch of unaddressed changes (see my previous comments) that prevent us from going forward with this. Thanks |
|
Hi, yes it was me, thank you! Your presentation was really nice too :) I will fix it but I still did not have the time to do it (properly) yet. I'm sorry for keeping this PR stuck, it was not supposed to stay like this so long... |
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.