mirror of
https://github.com/ceph/ceph
synced 2025-02-15 14:58:01 +00:00
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:
parent
94620be57c
commit
817baec24c
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user