You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
121 lines
3.2 KiB
121 lines
3.2 KiB
--- src/sub-func.c.orig 2003-03-19 13:28:15.000000000 +0100 |
|
+++ src/sub-func.c 2003-07-28 10:35:53.000000000 +0200 |
|
@@ -1267,7 +1267,7 @@ |
|
} |
|
#endif |
|
|
|
-#if defined(HAVE_GETHOSTBYNAME2) && defined(HAVE_INET_NTOP) |
|
+#if defined(HAVE_GETHOSTBYNAME2) && defined(HAVE_INET_NTOP) && defined(AF_INET6) |
|
char * |
|
_resolv_v6_ghbn2 (char *raddr, struct dnsresp *d_resp, char *extra) |
|
{ |
|
@@ -1308,7 +1308,7 @@ |
|
} |
|
#endif |
|
|
|
-#if defined(HAVE_GETADDRINFO) && defined(HAVE_INET_NTOP) |
|
+#if defined(HAVE_GETADDRINFO) && defined(HAVE_INET_NTOP) && defined(AF_INET6) |
|
char * |
|
_resolv_v6_gai (char *raddr, struct dnsresp *d_resp, char *extra) |
|
{ |
|
@@ -1393,13 +1393,19 @@ |
|
snprintf(d_resp->str, 127, "%s%s", inet_ntoa (sin->sin_addr), extra); |
|
d_resp->type = AF_INET; |
|
} |
|
+#ifdef AF_INET6 |
|
if (res->ai_family == PF_INET6) { |
|
sin6 = (struct sockaddr_in6 *) res->ai_addr; |
|
snprintf (retaddr, 1023, "%s%s", inet_ntop (AF_INET6, &sin6->sin6_addr, ip6addr, 128), extra); |
|
snprintf (d_resp->str, 127, "%s%s", inet_ntop (AF_INET6, &sin6->sin6_addr, ip6addr, 128), extra); |
|
d_resp->type = AF_INET6; |
|
} |
|
+#endif |
|
+#ifdef AF_INET6 |
|
if (res->ai_next && (res->ai_family == PF_INET || res->ai_family == PF_INET6)) |
|
+#else |
|
+ if (res->ai_next && res->ai_family == PF_INET) |
|
+#endif |
|
d_resp = new_dnsresp (d_resp); |
|
res = res->ai_next; |
|
} |
|
@@ -1460,14 +1466,20 @@ |
|
if ((f_gethostbyname2 || f_getaddrinfo) && f_inet_ntop) |
|
ipv6_cap = 1; |
|
|
|
+#ifdef AF_INET6 |
|
if (family != PF_INET && family != PF_INET6 && family != PF_UNSPEC) |
|
+#else |
|
+ if (family != PF_INET && family != PF_UNSPEC) |
|
+#endif |
|
return NULL; |
|
|
|
if (family == PF_INET && !ipv4_cap) |
|
return NULL; |
|
|
|
+#ifdef AF_INET6 |
|
if (family == PF_INET6 && !ipv6_cap) |
|
return NULL; |
|
+#endif |
|
|
|
if (family == PF_UNSPEC && (!ipv4_cap && !ipv6_cap)) |
|
return NULL; |
|
@@ -1475,8 +1487,10 @@ |
|
if (strlen (addr) > 1023) |
|
return NULL; |
|
|
|
+#ifdef AF_INET6 |
|
if (family == PF_UNSPEC && !ipv4_cap) |
|
family = PF_INET6; |
|
+#endif |
|
|
|
if (family == PF_UNSPEC && !ipv6_cap) |
|
family = PF_INET; |
|
@@ -1508,6 +1522,7 @@ |
|
return retaddr; |
|
} |
|
|
|
+#ifdef AF_INET6 |
|
if (family == PF_INET6) { |
|
if (f_getaddrinfo) { |
|
tmpstr = _resolv_v6_gai (raddr, d_resp, extra); |
|
@@ -1525,6 +1540,7 @@ |
|
return retaddr; |
|
} |
|
} |
|
+#endif |
|
|
|
if (family == PF_UNSPEC) { |
|
if (f_getaddrinfo) { |
|
--- src/sub.c.orig 2003-03-19 13:28:16.000000000 +0100 |
|
+++ src/sub.c 2003-07-28 10:37:10.000000000 +0200 |
|
@@ -496,6 +496,7 @@ |
|
ifarg_cur->type = IFT_V6; |
|
} |
|
|
|
+#if AF_INET6 |
|
if (abox->type == AT_V6 && abox->resolv) { |
|
d_resp_start = d_resp_cur = (struct dnsresp *) malloc (sizeof (struct dnsresp)); |
|
d_resp_start->next = NULL; |
|
@@ -526,6 +527,7 @@ |
|
|
|
free_dnsresp (d_resp_start); |
|
} |
|
+#endif |
|
|
|
if (abox->type == AT_INT) { |
|
if_cur = if_start; |
|
@@ -585,12 +587,14 @@ |
|
d_resp_cur = d_resp_start; |
|
while (d_resp_cur) { |
|
strncpy (ifarg_cur->cmdstr, abox->str, 127); |
|
+#if AF_INET6 |
|
if (d_resp_cur->type == AF_INET6) { |
|
strncpy (ifarg_cur->p_v6addr, d_resp_cur->str, 43); |
|
ifarg_cur->type = IFT_V6; |
|
|
|
mk_ipv6addr (&ifarg_cur->v6ad, ifarg_cur->p_v6addr); |
|
} |
|
+#endif |
|
if (d_resp_cur->type == AF_INET) { |
|
tmpstr = strstr (d_resp_cur->str, " "); |
|
if (tmpstr != NULL && (strlen (tmpstr) > 0)) {
|
|
|