get_endpoint_peer() may see an EEXIST while updating the local peer tables; this indicates there was a conflict between a queried EID (via Get Endpoint ID to the peer), and another entry in the peer table.
We currently handle this by returning a dbus error directly from get_endpoint_peer(), but this is recoverable from a SetupEndpoint call, by assigning a new EID.
Instead of returning the dbus error in get_endpoint_peer, leave the EXIST handling to the caller, where the behaviours are different:
LearnEndpoint needs to propogate the error to the caller
get_endpoint_peer() may see an EEXIST while updating the local peer tables; this indicates there was a conflict between a queried EID (via Get Endpoint ID to the peer), and another entry in the peer table.
We currently handle this by returning a dbus error directly from get_endpoint_peer(), but this is recoverable from a SetupEndpoint call, by assigning a new EID.
Instead of returning the dbus error in get_endpoint_peer, leave the EXIST handling to the caller, where the behaviours are different:
LearnEndpoint needs to propogate the error to the caller
SetupEndpoint can attempt to assign a new EID
Fixes: https://github.com/CodeConstruct/mctp/issues/19 Reported-by: Muhammad Usama Chaudhry chaudhryusama@gmail.com