瀏覽代碼

catch misconfigured machines that return hostname as fqdn

svn:r610
Roger Dingledine 20 年之前
父節點
當前提交
5c563939ef
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/or/routers.c

+ 4 - 0
src/or/routers.c

@@ -1130,6 +1130,10 @@ int router_rebuild_descriptor(void) {
       return -1;
     }
     address = localhostname;
+    if(!strchr(address,'.')) {
+      log_fn(LOG_WARN,"fqdn '%s' has only one element. Misconfigured machine?",address);
+      return -1;
+    }
   }
   ri = tor_malloc(sizeof(routerinfo_t));
   ri->address = tor_strdup(address);