From: Sage Weil Date: Thu, 24 Jan 2019 22:48:06 +0000 (-0600) Subject: msg/async/ProtocolV2: be forgiving in server identity check X-Git-Tag: v14.1.0~271^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5145120c2e5f2c33fa3488119edc445caab2a933;p=ceph.git msg/async/ProtocolV2: be forgiving in server identity check If we parse something out of mon_host or are given an addr by a user, we should succeed as long as our target_addr is one of the destination's addrs. Signed-off-by: Sage Weil --- diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index 892be9e94018..6cf8732bfef1 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -2323,9 +2323,11 @@ CtPtr ProtocolV2::handle_server_ident(char *payload, uint32_t length) { << server_ident.cookie() << dendl; // is this who we intended to talk to? - if (*connection->peer_addrs != server_ident.addrs()) { + // be a bit forgiving here, since we may be connecting based on addresses parsed out + // of mon_host or something. + if (!server_ident.addrs().contains(connection->target_addr)) { ldout(cct,1) << __func__ << " peer identifies as " << server_ident.addrs() - << " not " << *connection->peer_addrs << dendl; + << ", does not include " << connection->target_addr << dendl; return _fault(); }