浏览代码

Another case of the same.

svn:r1099
Nick Mathewson 22 年之前
父节点
当前提交
72568d2620
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      src/or/routerlist.c

+ 7 - 4
src/or/routerlist.c

@@ -426,10 +426,13 @@ int router_compare_addr_to_exit_policy(uint32_t addr, uint16_t port,
       }
       }
     } else {
     } else {
       /* Address is known */
       /* Address is known */
-      if ( (addr & tmpe->msk) == (tmpe->addr & tmpe->msk) &&
-           (port >= tmpe->prt_min && port <= tmpe->prt_max) ) {
-        /* Exact match for the policy */
-        match = 1;
+      if ((addr & tmpe->msk) == (tmpe->addr & tmpe->msk)) {
+        if (port >= tmpe->prt_min && port <= tmpe->prt_max) {
+          /* Exact match for the policy */
+          match = 1;
+        } else if (!port) {
+          maybe = 1;
+        }
       }
       }
     }
     }
     if (maybe) {
     if (maybe) {