Skip to content

Commit 291baca

Browse files
mctpd: reset pool for invalid set endpoint id response
If endpoint responds with some error in endpoint_send_set_endpoint_id() , assumed bridge pool space needs to reset too, this is needed as it misleads remove_peer() to delete gateway routes too which will only be created after bridge pool allocation Signed-off-by: Faizan Ali <faizana@nvidia.com>
1 parent 9328fbb commit 291baca

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/mctpd.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,12 @@ static int endpoint_assign_eid(struct ctx *ctx, sd_bus_error *berr,
20872087
sd_bus_error_setf(
20882088
berr, SD_BUS_ERROR_FAILED,
20892089
"Endpoint returned failure to Set Endpoint ID");
2090+
20902091
if (rc < 0) {
2092+
// we have not yet created the pool route, reset here so that
2093+
// remove_peer() does not attempt to remove it
2094+
peer->pool_size = 0;
2095+
peer->pool_start = 0;
20912096
remove_peer(peer);
20922097
return rc;
20932098
}

0 commit comments

Comments
 (0)