crimson/net: fix peer_addr sync in during handshake

Signed-off-by: Yingxin <yingxin.cheng@intel.com>
This commit is contained in:
Yingxin 2018-08-30 17:45:46 +08:00
parent c48de27480
commit bee7be532d
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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));