39 lines
908 B
Text
39 lines
908 B
Text
$NetBSD: patch-ac,v 1.3 2001/07/17 01:30:31 itojun Exp $
|
|
|
|
--- lib/lwres/getaddrinfo.c.orig Sat Jul 14 08:34:01 2001
|
|
+++ lib/lwres/getaddrinfo.c Tue Jul 17 10:15:03 2001
|
|
@@ -31,6 +31,10 @@
|
|
#include <lwres/net.h>
|
|
#include <lwres/netdb.h>
|
|
|
|
+#ifdef __KAME__
|
|
+#include <net/if.h>
|
|
+#endif
|
|
+
|
|
#define SA(addr) ((struct sockaddr *)(addr))
|
|
#define SIN(addr) ((struct sockaddr_in *)(addr))
|
|
#define SIN6(addr) ((struct sockaddr_in6 *)(addr))
|
|
@@ -253,14 +257,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 {
|