changeset 1038:c95837a6b303

* src/getaddrinfo.c (getaddrinfo): Corrected a bad patch merge from earlier which failed to delete some code. This fixed the dns1 tests for IPv6 lookups. * src/getaddrinfo.c: Changed '#ifdef CYGPKG_NS_DNS' to '#ifdef CYGPKG_NS_DNS_BUILD', so it would compile if this CDL option is not selected. Changed the call to 'numeric_node_addr' so it uses the correct number of arguments.
author asl
date Thu, 22 May 2003 14:28:54 +0000
parents 03e358feb300
children 13e9f49a7dcb
files packages/net/common/current/ChangeLog packages/net/common/current/src/getaddrinfo.c
diffstat 2 files changed, 20 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/common/current/ChangeLog
+++ b/packages/net/common/current/ChangeLog
@@ -1,3 +1,17 @@
+2003-05-21  Andrew Lunn  <andrew.lunn@ascom.ch>
+
+	* src/getaddrinfo.c (getaddrinfo): Corrected a bad patch merge
+	from earlier which failed to delete some code. This fixed the dns1
+	tests for IPv6 lookups.
+
+2003-05-19  Michael Checky  <Michael_Checky@ThermoKing.com>
+            Andrew Lunn     <andrew.lunn@ascom.ch>
+	
+	* src/getaddrinfo.c: Changed '#ifdef CYGPKG_NS_DNS' to
+	'#ifdef CYGPKG_NS_DNS_BUILD', so it would compile if this CDL
+	option is not selected.  Changed the call to 'numeric_node_addr'
+	so it uses the correct number of arguments.
+
 2003-05-14  Bob Holmberg  <bob_holmberg@yahoo.com>
 
 	* src/tftp_server.c (tftpd_read_file): Open the file for reading,
--- a/packages/net/common/current/src/getaddrinfo.c
+++ b/packages/net/common/current/src/getaddrinfo.c
@@ -41,8 +41,10 @@
 #include <pkgconf/system.h>
 #ifdef CYGPKG_NS_DNS
 #include <pkgconf/ns_dns.h>
+#ifdef CYGPKG_NS_DNS_BUILD
 #include <cyg/ns/dns/dns.h>
 #endif
+#endif
 
 extern int  sprintf(char *, const char *, ...);
 extern long strtol(const char *, char **, int);
@@ -219,7 +221,7 @@ static int
 with_node_addr(struct addrinfo *ai, const char *node, 
                const struct addrinfo *hints, int port) {
     
-#ifdef CYGPKG_NS_DNS
+#ifdef CYGPKG_NS_DNS_BUILD
     struct sockaddr addrs[CYGNUM_NS_DNS_GETADDRINFO_ADDRESSES];
     int nresults;
     int i;
@@ -262,7 +264,7 @@ with_node_addr(struct addrinfo *ai, cons
     }
     return EAI_NONE;
 #else
-    return (numeric_node_addr(ai, node, hints, hints->ai_family, port));
+    return (numeric_node_addr(ai, node, hints, port));
 #endif
 }
 
@@ -277,7 +279,6 @@ getaddrinfo(const char *nodename, const 
     char *endptr;
     int port = 0;
     int err;
-    int used;
 
     if (hints == (struct addrinfo *)NULL) {
         dflt_hints.ai_flags = 0;  // No special flags
@@ -376,11 +377,7 @@ getaddrinfo(const char *nodename, const 
         freeaddrinfo(ai);
         return err;
     }
-    if (err == EAI_NONE) {
-        ai->ai_family = AF_INET;
-        used = 1;
-    }
-    
+
     if ((hints->ai_flags & AI_CANONNAME) && !nodename) {
         ai->ai_canonname = malloc(strlen("localhost")+1);
         if (ai->ai_canonname) {
@@ -479,7 +476,7 @@ getnameinfo (const struct sockaddr *sa, 
         if (host != (char *)NULL) {
             if ( !numeric) {
                 error = EAI_NONAME;
-#ifdef CYGPKG_NS_DNS
+#ifdef CYGPKG_NS_DNS_BUILD
                 error = -cyg_dns_getnameinfo(sa, host,hostlen);
 #endif
                 if ((error == EAI_NONAME) && (flags & NI_NAMEREQD)) {