Skip to content

Commit 3c15e0c

Browse files
mctpd: reset pool for invalid set endpoint id response
If endpoint responds with some invalid endpoint id range, assumed bridge pool space needs to reset too, this is needed as it misleads remove_peer() to delete gateway routes too which only be created after bridge pool allocation Signed-off-by: Faizan Ali <[email protected]>
1 parent 196f4db commit 3c15e0c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/mctpd.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2150,10 +2150,14 @@ static int endpoint_assign_eid(struct ctx *ctx, sd_bus_error *berr,
21502150
add_peer_route(peer);
21512151

21522152
rc = endpoint_send_set_endpoint_id(peer, &new_eid, &req_pool_size);
2153-
if (rc == -ECONNREFUSED)
2153+
if (rc == -ECONNREFUSED) {
21542154
sd_bus_error_setf(
21552155
berr, SD_BUS_ERROR_FAILED,
21562156
"Endpoint returned failure to Set Endpoint ID");
2157+
peer->pool_size = 0;
2158+
peer->pool_start = 0;
2159+
}
2160+
21572161
if (rc < 0) {
21582162
remove_peer(peer);
21592163
return rc;

0 commit comments

Comments
 (0)