]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: trust peer_addr based on port+pid if s_addr=0, to avoid weird ip-less startup...
authorSage Weil <sage@newdream.net>
Wed, 14 May 2008 22:12:52 +0000 (15:12 -0700)
committerSage Weil <sage@newdream.net>
Wed, 14 May 2008 22:12:52 +0000 (15:12 -0700)
src/msg/SimpleMessenger.cc

index 5eacb03d6ca4b983d9f3d9645f16ad0cb96931b3..5957b3c9121c668f475b56573bbe318dd50c3089 100644 (file)
@@ -969,9 +969,15 @@ int Rank::Pipe::connect()
   }
   dout(20) << "connect read peer addr " << paddr << " on socket " << newsd << dendl;
   if (!peer_addr.is_local_to(paddr)) {
-    dout(0) << "connect peer identifies itself as " 
-           << paddr << "... wrong node!" << dendl;
-    goto fail;
+    if (paddr.ipaddr.sin_addr.s_addr == 0 &&
+       peer_addr.ipaddr.sin_port == paddr.ipaddr.sin_port) {
+      dout(0) << "connect claims to be " 
+             << paddr << " not " << peer_addr << " - presumably this is the same node!" << dendl;
+    } else {
+      dout(0) << "connect claims to be " 
+             << paddr << " not " << peer_addr << " - wrong node!" << dendl;
+      goto fail;
+    }
   }
 
   // identify myself, and send initial cseq