This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: Patch to fix compile errors in getaddrinfo.c
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- To: Michael Checky <Michael_Checky at thermoking dot com>
- Cc: ecos-patches at sources dot redhat dot com
- Date: Thu, 22 May 2003 16:27:45 +0200
- Subject: Re: Patch to fix compile errors in getaddrinfo.c
- References: <OFCC94280A.FABDEF1E-ON86256D2B.006D392D@ingerrand.com>
On Mon, May 19, 2003 at 02:56:16PM -0500, Michael Checky wrote:
> I've attached a patch to fix a few compile errors in
> 'packages/net/common/current/src/getaddrinfo.c'. They occur when the
> 'Build DNS' option is not selected.
>
> Michael Checky
> (See attached file: getaddrinfo.pat)
Thanks for the patch.
It was not quite correct. Attached is the patch i just committed. It
also fixes another problem i found while testing. Seems my last merge
from another tree did not go cleanly and left some code in it should
not have.
Andrew
? packages/net/openssl
Index: packages/net/common/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/common/current/ChangeLog,v
retrieving revision 1.34
diff -u -r1.34 ChangeLog
--- packages/net/common/current/ChangeLog 14 May 2003 07:02:06 -0000 1.34
+++ packages/net/common/current/ChangeLog 22 May 2003 14:25:46 -0000
@@ -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,
Index: packages/net/common/current/src/getaddrinfo.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/common/current/src/getaddrinfo.c,v
retrieving revision 1.5
diff -u -r1.5 getaddrinfo.c
--- packages/net/common/current/src/getaddrinfo.c 12 May 2003 10:13:38 -0000 1.5
+++ packages/net/common/current/src/getaddrinfo.c 22 May 2003 14:25:46 -0000
@@ -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 @@
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 @@
}
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 @@
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 @@
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 @@
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)) {