CodeConstruct / mctp

MCTP userspace tools
GNU General Public License v2.0
30 stars 17 forks source link

mctpd: handle EEXIST outside of get_endpoint_peer #26

Closed jk-ozlabs closed 8 months ago

jk-ozlabs commented 8 months ago

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:

Fixes: https://github.com/CodeConstruct/mctp/issues/19 Reported-by: Muhammad Usama Chaudhry chaudhryusama@gmail.com