crimson/osd/osd_operations/client_request: Fix client blocklisting

See #50835.
In crimson, conn is independently maintained outside Message.
Therefore, when trying to use the message's connection for `get_peer_addr()`
we won't be able to get the peer address.

Signed-off-by: Matan Breizman <mbreizma@redhat.com>
This commit is contained in:
Matan Breizman 2023-05-07 13:29:22 +00:00
parent e87b2e0d60
commit 9c1531ca40

View File

@ -272,8 +272,8 @@ ClientRequest::do_process(
return reply_op_error(pg, -ENAMETOOLONG);
} else if (m->get_hobj().oid.name.empty()) {
return reply_op_error(pg, -EINVAL);
} else if (pg->get_osdmap()->is_blocklisted(m->get_source_addr())) {
logger().info("{} is blocklisted", m->get_source_addr());
} else if (pg->get_osdmap()->is_blocklisted(conn->get_peer_addr())) {
logger().info("{} is blocklisted", conn->get_peer_addr());
return reply_op_error(pg, -EBLOCKLISTED);
}