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

UDP endpoint mapping uses incorrect masking values. #304

Open
thirtytwobits opened this issue Jun 28, 2023 · 0 comments
Open

UDP endpoint mapping uses incorrect masking values. #304

thirtytwobits opened this issue Jun 28, 2023 · 0 comments

Comments

@thirtytwobits
Copy link
Member

---
 pycyphal/transport/udp/_ip/_endpoint_mapping.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pycyphal/transport/udp/_ip/_endpoint_mapping.py b/pycyphal/transport/udp/_ip/_endpoint_mapping.py
index 6b4168d..f3cf6cc 100644
--- a/pycyphal/transport/udp/_ip/_endpoint_mapping.py
+++ b/pycyphal/transport/udp/_ip/_endpoint_mapping.py
@@ -22,9 +22,9 @@ FIXED_MASK_PREFIX = 0b_11111111_11111111_00000000_00000000
 Masks the 16 most significant bits of the multicast group address. To check whether the address is Cyphal/UDP.
 """
 
-SUBJECT_ID_MASK = 2**15 - 1
+SUBJECT_ID_MASK = 0b_00000000_00000000_00011111_11111111
 """
-Masks the 14 least significant bits of the multicast group address (v4/v6) that represent the subject-ID. (Message)
+Masks the 13 least significant bits of the multicast group address (v4/v6) that represent the subject-ID. (Message)
 """
 
 DESTINATION_NODE_ID_MASK = 0xFFFF
@@ -38,7 +38,7 @@ SNM_BIT_MASK = 0b_00000000_00000001_00000000_00000000
 Service, Not Message: Masks the bit that determines whether the address represents a Message (=0) or Service (=1)
 """
 
-CYPHAL_UDP_IPV4_ADDRESS_VERSION = 0b_00000000_00100000_00000000_00000000
+CYPHAL_UDP_IPV4_ADDRESS_VERSION = 0b_00000000_01000000_00000000_00000000
 """
 Cyphal/UDP uses this bit to isolate IP header version 0 traffic
 (note that the IP header version is not, necessarily, the same as the Cyphal Header version)
-- 
2.37.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants