瀏覽代碼

Do not unite() peers across different IP scopes as this would pretty much never work.

Adam Ierymenko 10 年之前
父節點
當前提交
a1005ca858
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      node/Switch.cpp

+ 3 - 0
node/Switch.cpp

@@ -296,6 +296,9 @@ bool Switch::unite(const Address &p1,const Address &p2,bool force)
 	if (!(cg.first))
 		return false;
 
+	if (cg.first.ipScope() != cg.second.ipScope())
+		return false;
+
 	// Addresses are sorted in key for last unite attempt map for order
 	// invariant lookup: (p1,p2) == (p2,p1)
 	Array<Address,2> uniteKey;