From bee7be532dfa232b70e886edc4ba3e8f5523e55d Mon Sep 17 00:00:00 2001 From: Yingxin Date: Thu, 30 Aug 2018 17:45:46 +0800 Subject: [PATCH] crimson/net: fix peer_addr sync in during handshake Signed-off-by: Yingxin --- src/crimson/net/SocketConnection.cc | 3 +-- src/crimson/net/SocketMessenger.cc | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crimson/net/SocketConnection.cc b/src/crimson/net/SocketConnection.cc index 67a3e3d1771..69a729505db 100644 --- a/src/crimson/net/SocketConnection.cc +++ b/src/crimson/net/SocketConnection.cc @@ -801,8 +801,7 @@ seastar::future<> SocketConnection::client_handshake(entity_type_t peer_type, validate_peer_addr(saddr, peer_addr); if (my_addr != caddr) { - // take peer's address for me, but preserve my port/nonce - caddr.set_port(my_addr.get_port()); + // take peer's address for me, but preserve my nonce caddr.nonce = my_addr.nonce; my_addr = caddr; } diff --git a/src/crimson/net/SocketMessenger.cc b/src/crimson/net/SocketMessenger.cc index f601d223f6c..520e3d61538 100644 --- a/src/crimson/net/SocketMessenger.cc +++ b/src/crimson/net/SocketMessenger.cc @@ -73,6 +73,7 @@ seastar::future<> SocketMessenger::accept(seastar::connected_socket socket, { // allocate the connection entity_addr_t peer_addr; + peer_addr.set_type(entity_addr_t::TYPE_DEFAULT); peer_addr.set_sockaddr(&paddr.as_posix_sockaddr()); ConnectionRef conn = new SocketConnection(this, get_myaddr(), peer_addr, std::move(socket));