msg/async: fix IP inference

socket_addr is *our* socket address; target_addr is the remote peer's
socket address.  We are inferring the remote's IP address here.

Fixes: http://tracker.ceph.com/issues/37882
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2019-01-12 06:47:59 -06:00
parent 94620be57c
commit 817baec24c
2 changed files with 3 additions and 3 deletions

View File

@ -1794,7 +1794,7 @@ CtPtr ProtocolV1::handle_client_banner(char *buffer, int r) {
if (peer_addr.is_blank_ip()) {
// peer apparently doesn't know what ip they have; figure it out for them.
int port = peer_addr.get_port();
peer_addr.u = connection->socket_addr.u;
peer_addr.set_sockaddr(connection->target_addr.get_sockaddr());
peer_addr.set_port(port);
ldout(cct, 0) << __func__ << " accept peer addr is really " << peer_addr

View File

@ -1837,10 +1837,10 @@ CtPtr ProtocolV2::handle_client_addrvec(char *buffer, int r) {
if (peer_addr.is_blank_ip()) {
// peer apparently doesn't know what ip they have; figure it out for them.
int port = peer_addr.get_port();
peer_addr.u = connection->socket_addr.u;
peer_addr.set_sockaddr(connection->target_addr.get_sockaddr());
peer_addr.set_port(port);
ldout(cct, 0) << __func__ << " accept peer addr is really " << peer_addr
<< " (socket is " << connection->socket_addr << ")"
<< " (target is " << connection->target_addr << ")"
<< dendl;
peer_addr_p = &peer_addr;
}