浏览代码

in hosts file lookups, honor first canonical name regardless of family

prior to this change, the canonical name came from the first hosts
file line matching the requested family, so the canonical name for a
given hostname could differ depending on whether it was requested with
AF_UNSPEC or a particular family (AF_INET or AF_INET6). now, the
canonical name is deterministically the first one to appear with the
requested name as an alias.
Rich Felker 4 年之前
父节点
当前提交
f1198ea3cf
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/network/lookup_name.c

+ 1 - 1
src/network/lookup_name.c

@@ -80,7 +80,7 @@ static int name_from_hosts(struct address buf[static MAXADDRS], char canon[stati
 			continue;
 		default:
 			badfam = EAI_NONAME;
-			continue;
+			break;
 		}
 
 		if (have_canon) continue;