$NetBSD: patch-ac,v 1.3 2001/01/28 06:50:22 itojun Exp $ support for kame scopeid extension (assumes that link scope = interface) --- lib/lwres/getaddrinfo.c- Sun Jan 28 15:34:17 2001 +++ lib/lwres/getaddrinfo.c Sun Jan 28 15:38:37 2001 @@ -28,6 +28,9 @@ #include #include +#ifdef __KAME__ +#include +#endif #include #include @@ -262,14 +265,18 @@ p = strchr(ntmp, '%'); ep = NULL; - /* - * Vendors may want to support non-numeric - * scopeid around here. - */ +#ifdef __KAME__ + if (p != NULL) { + scopeid = if_nametoindex(p + 1); + if (scopeid) + p = NULL; + } +#endif - if (p != NULL) + if (p != NULL) { scopeid = (lwres_uint32_t)strtoul(p + 1, &ep, 10); + } if (p != NULL && ep != NULL && ep[0] == '\0') *p = '\0'; else {