Browse Source

Make timeout also apply to null check in iam()

Adam Ierymenko 10 years ago
parent
commit
59fa687830
1 changed files with 1 additions and 1 deletions
  1. 1 1
      node/SelfAwareness.cpp

+ 1 - 1
node/SelfAwareness.cpp

@@ -96,7 +96,7 @@ void SelfAwareness::iam(const Address &reporter,const InetAddress &reporterPhysi
 
 
 	PhySurfaceEntry &entry = _phy[PhySurfaceKey(reporter,scope)];
 	PhySurfaceEntry &entry = _phy[PhySurfaceKey(reporter,scope)];
 
 
-	if (!entry.ts) {
+	if ((now - entry.ts) >= ZT_SELFAWARENESS_ENTRY_TIMEOUT) {
 		entry.mySurface = myPhysicalAddress;
 		entry.mySurface = myPhysicalAddress;
 		entry.ts = now;
 		entry.ts = now;
 		TRACE("learned physical address %s for scope %u as seen from %s(%s) (replaced <null>)",myPhysicalAddress.toString().c_str(),(unsigned int)scope,reporter.toString().c_str(),reporterPhysicalAddress.toString().c_str());
 		TRACE("learned physical address %s for scope %u as seen from %s(%s) (replaced <null>)",myPhysicalAddress.toString().c_str(),(unsigned int)scope,reporter.toString().c_str(),reporterPhysicalAddress.toString().c_str());