OpenCyphal / OpenCyphal/pycyphal
UDP endpoint mapping uses incorrect masking values.
Open
@maksimdrachov is already working on this.
Since Jun 29, 2023.
class-defect
domain-transport-udp
severity-minor
- Dominant language
- Python
- Stars
- 142
- Forks
- 110
- PR merge metrics
- No merged PRs in 30d
Description
---
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.