Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

claire-lex
Copy link
Contributor

This PR introduces a few changes to the KNXnet/IP layer, last updated in 2021:

  • Fix validation and support issues on KNX individual addresses and KNX group addresses (see below)
  • Add a few recognized KNX codes and supported types for MultipleTypeFields in complex packets
  • Add basic and KNX address-related unit tests

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.

test_addr = CEMI(message_code=0x11) # L_Data.req
test_addr.cemi_data.address_type = 0 # Individual address
test_addr.cemi_data.destination_address = "1.1.1"

@guedou
Copy link
Member

guedou commented Feb 16, 2025

Thanks for the PR. Could you fix the flake8 issues at https://github.com/secdev/scapy/actions/runs/13262979518/job/37023594039?pr=4663 ?

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