OpenCyphal / pycyphal

Python implementation of the Cyphal protocol stack.
https://pycyphal.readthedocs.io/
MIT License
119 stars 106 forks source link

PnP allocator: incorrect handling of v1 allocation requests #160

Closed pavel-kirienko closed 2 years ago

pavel-kirienko commented 3 years ago

https://github.com/UAVCAN/pyuavcan/blob/bdc9db29c63af16c60f8a41b47b27ca0328e5a52/pyuavcan/application/plug_and_play.py#L390-L392

When the allocator receives a response to uavcan.node.GetInfo, the pseudo-unique-ID is unconditionally overwritten with a locally computed hash. If the client uses a different hash function, it makes the allocator always provide a new node-ID to the same client at every subsequent allocation, which will exhaust the allocation table quickly. The referenced SQL transaction should not touch the pseudo-unique-ID at all.