From 2004f62eea1d7940b4d69e6d0a01ed9dea6c5255 Mon Sep 17 00:00:00 2001 From: ume Date: Sat, 11 Aug 2001 15:01:12 +0000 Subject: Fill _res.sort_list with harmless entry. sortlist for IPv6/IPv4 is stored in _res_ext.sort_list, and sortlist for IPv4 is stored in _res.sort_list for backward compatibility. However, both sort_list's are maintaind by just one index _res.nsort. So, when IPv6 address is specified to sortlist, empty entry was created in _res.sort_list. It broke sortlist facility of gethostbyname(). Discussed on users@jp.ipv6.org. --- lib/libc/net/res_init.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libc') diff --git a/lib/libc/net/res_init.c b/lib/libc/net/res_init.c index 035dd05..2d25677 100644 --- a/lib/libc/net/res_init.c +++ b/lib/libc/net/res_init.c @@ -429,6 +429,9 @@ res_init() u++; } } + _res.sort_list[nsort].addr.s_addr = + (u_int32_t)0xffffffff; + _res.sort_list[nsort].mask = (u_int32_t)0xffffffff; nsort++; } *cp = n; -- cgit v1.1