]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/ProtocolV2: be forgiving in server identity check
authorSage Weil <sage@redhat.com>
Thu, 24 Jan 2019 22:48:06 +0000 (16:48 -0600)
committerRicardo Dias <rdias@suse.com>
Fri, 25 Jan 2019 09:15:19 +0000 (09:15 +0000)
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 <sage@redhat.com>
src/msg/async/ProtocolV2.cc

index 892be9e94018fb1997434b412305326577c1bd87..6cf8732bfef1ccf644f4f65413b62da2f8dc0538 100644 (file)
@@ -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();
   }