Closed emrainey closed 10 months ago
In txMakeServiceSessionSpecifier, the Node ID is not being set in the function, resulting in responses being sent to the wrong Multicast IP address.
txMakeServiceSessionSpecifier
From https://github.com/OpenCyphal-Garage/libudpard/blob/main/libudpard/udpard.c#L259
((UdpardIPv4Addr) UDPARD_NODE_ID_MASK & (UdpardIPv4Addr) service_id)) | should be ((UdpardIPv4Addr) UDPARD_NODE_ID_MASK & (UdpardIPv4Addr) src_node_id)) |
((UdpardIPv4Addr) UDPARD_NODE_ID_MASK & (UdpardIPv4Addr) service_id)) |
((UdpardIPv4Addr) UDPARD_NODE_ID_MASK & (UdpardIPv4Addr) src_node_id)) |
But this call to construct Service Multicast IP address needs to use the remote Node ID, not the local Node ID. https://github.com/OpenCyphal-Garage/libudpard/blob/main/libudpard/udpard.c#L299
Looks like there is a unit test but it's also not actually looking at the constructed IP address? https://github.com/OpenCyphal-Garage/libudpard/blob/main/tests/test_private_tx.cpp#LL107C39-L107C119
In
txMakeServiceSessionSpecifier
, the Node ID is not being set in the function, resulting in responses being sent to the wrong Multicast IP address.From https://github.com/OpenCyphal-Garage/libudpard/blob/main/libudpard/udpard.c#L259
((UdpardIPv4Addr) UDPARD_NODE_ID_MASK & (UdpardIPv4Addr) service_id)) |
should be((UdpardIPv4Addr) UDPARD_NODE_ID_MASK & (UdpardIPv4Addr) src_node_id)) |
But this call to construct Service Multicast IP address needs to use the remote Node ID, not the local Node ID. https://github.com/OpenCyphal-Garage/libudpard/blob/main/libudpard/udpard.c#L299