$NetBSD: patch-ab,v 1.7 2004/05/15 21:00:58 itojun Exp $

--- lib/lwres/getnameinfo.c-	2004-05-16 05:01:45.000000000 +0900
+++ lib/lwres/getnameinfo.c	2004-05-16 05:02:50.000000000 +0900
@@ -62,6 +62,10 @@
 #include <lwres/net.h>
 #include <lwres/netdb.h>
 
+#ifdef __KAME__
+#include <net/if.h>
+#endif
+
 #include "assert_p.h"
 
 #define SUCCESS 0
@@ -210,13 +214,10 @@
 		    ((const struct sockaddr_in6 *)sa)->sin6_scope_id) {
 			char *p = numaddr + strlen(numaddr);
 			const char *stringscope = NULL;
-#if 0
+#ifdef __KAME__
 			if ((flags & NI_NUMERICSCOPE) == 0) {
-				/*
-				 * Vendors may want to add support for
-				 * non-numeric scope identifier.
-				 */
-				stringscope = foo;
+				stringscope = if_indextoname(
+				    ((const struct sockaddr_in6 *)sa)->sin6_scope_id);
 			}
 #endif
 			if (stringscope == NULL) {
