From 21448b46272429cd4260638c31ec239118e6fb02 Mon Sep 17 00:00:00 2001 From: shin Date: Tue, 28 Dec 1999 05:37:39 +0000 Subject: Small bug fix and improvements (1)added error check of if_nameindex() return value at getaddrinfo(). (2)print out more detailed information when getaddrinfo() error value is EAI_SYSTEM.(in this case system error num is kept in errno) (1) is Discovered by: jinmei@kame.net in KAME environment. --- lib/libc/net/getaddrinfo.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/libc') diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c index 79b07de..dd85243 100644 --- a/lib/libc/net/getaddrinfo.c +++ b/lib/libc/net/getaddrinfo.c @@ -766,6 +766,10 @@ explore_numeric_scope(pai, hostname, servname, res) #ifdef INET6 case AF_INET6: scope = if_nametoindex(cp); + if (scope == 0) { + error = EAI_SYSTEM; + goto free; + } break; #endif } @@ -784,6 +788,9 @@ explore_numeric_scope(pai, hostname, servname, res) } } +#ifdef INET6 +free: +#endif free(hostname2); return error; -- cgit v1.1