]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msgr: make sure nonce matches too when connecting to peer
authorSage Weil <sage@newdream.net>
Tue, 9 Dec 2008 16:48:03 +0000 (08:48 -0800)
committerSage Weil <sage@newdream.net>
Tue, 9 Dec 2008 16:48:03 +0000 (08:48 -0800)
Otherwise the predictable port numbers cause problems.

src/msg/SimpleMessenger.cc

index 33bbac79cd5cf9453bb371616adfe08a31c5d7d7..157deaf660de62506f0735e1f2b6bb48352ee87e 100644 (file)
@@ -1198,7 +1198,8 @@ int Rank::Pipe::connect()
   dout(20) << "connect read peer addr " << paddr << " on socket " << sd << dendl;
   if (!peer_addr.is_local_to(paddr)) {
     if (paddr.ipaddr.sin_addr.s_addr == 0 &&
-       peer_addr.ipaddr.sin_port == paddr.ipaddr.sin_port) {
+       peer_addr.ipaddr.sin_port == paddr.ipaddr.sin_port &&
+       peer_addr.nonce == paddr.nonce) {
       dout(0) << "connect claims to be " 
              << paddr << " not " << peer_addr << " - presumably this is the same node!" << dendl;
     } else {