aboutsummaryrefslogtreecommitdiff
path: root/ares
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-01-14 13:08:50 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-01-14 13:08:50 +0000
commit29b6a732f36c27d971f8bbbf206f99d1d75cfffd (patch)
treec879a7dcced6e41cdddcdc9a926aa26144d48701 /ares
parent3dcd6bc597ab7ecb9e9f69c2667bf18ecd26751a (diff)
- ares.h no longer uses the HAVE_STRUCT_IN6_ADDR define check, but instead it
now declares the private struct ares_in6_addr for all systems instead of relying on one possibly not present in the system.
Diffstat (limited to 'ares')
-rw-r--r--ares/CHANGES5
-rw-r--r--ares/RELEASE-NOTES3
-rw-r--r--ares/ares.h26
3 files changed, 24 insertions, 10 deletions
diff --git a/ares/CHANGES b/ares/CHANGES
index 5bb02f744..232147211 100644
--- a/ares/CHANGES
+++ b/ares/CHANGES
@@ -1,5 +1,10 @@
Changelog for the c-ares project
+* January 14 2009 (Daniel Stenberg)
+- ares.h no longer uses the HAVE_STRUCT_IN6_ADDR define check, but instead it
+ now declares the private struct ares_in6_addr for all systems instead of
+ relying on one possibly not present in the system.
+
* January 13 2009 (Phil Blundell)
- ares__send_query() now varies the retry timeout pseudo-randomly to avoid
packet storms when several queries were started at the same time.
diff --git a/ares/RELEASE-NOTES b/ares/RELEASE-NOTES
index 3d3db9c57..8b5aa49fb 100644
--- a/ares/RELEASE-NOTES
+++ b/ares/RELEASE-NOTES
@@ -2,7 +2,8 @@ This is what's new and changed in the c-ares 1.6.1 release:
Changed:
- o
+ o in6_addr is not used in ares.h anymore, but a private ares_in6_addr is instead
+ declared and used
Fixed:
diff --git a/ares/ares.h b/ares/ares.h
index 919bafb7c..ab829dbe4 100644
--- a/ares/ares.h
+++ b/ares/ares.h
@@ -1,7 +1,7 @@
/* $Id$ */
/* Copyright 1998 by the Massachusetts Institute of Technology.
- * Copyright (C) 2007-2008 by Daniel Stenberg
+ * Copyright (C) 2007-2009 by Daniel Stenberg
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
@@ -275,21 +275,29 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
int ares_expand_string(const unsigned char *encoded, const unsigned char *abuf,
int alen, unsigned char **s, long *enclen);
-#if !defined(HAVE_STRUCT_IN6_ADDR) && !defined(s6_addr)
-struct in6_addr {
+/*
+ * NOTE: before c-ares 1.6.1 we would most often use the system in6_addr
+ * struct below when ares itself was built, but many apps would use this
+ * private version since the header checked a HAVE_* define for it. Starting
+ * with 1.6.1 we always declare and use our own to stop relying on the
+ * system's one.
+ */
+struct ares_in6_addr {
union {
unsigned char _S6_u8[16];
} _S6_un;
};
-#define s6_addr _S6_un._S6_u8
-#endif
+/*
+ * TODO: the structs 'addrttl' and 'addr6ttl' really should get their names
+ * prefixed with ares_ to keep them in our own "name space".
+ */
struct addrttl {
struct in_addr ipaddr;
int ttl;
};
struct addr6ttl {
- struct in6_addr ip6addr;
+ struct ares_in6_addr ip6addr;
int ttl;
};
@@ -304,12 +312,12 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
struct hostent **host,
struct addrttl *addrttls, int *naddrttls);
int ares_parse_aaaa_reply(const unsigned char *abuf, int alen,
- struct hostent **host,
- struct addr6ttl *addrttls, int *naddrttls);
+ struct hostent **host,
+ struct addr6ttl *addrttls, int *naddrttls);
int ares_parse_ptr_reply(const unsigned char *abuf, int alen, const void *addr,
int addrlen, int family, struct hostent **host);
int ares_parse_ns_reply(const unsigned char *abuf, int alen,
- struct hostent **host);
+ struct hostent **host);
void ares_free_string(void *str);
void ares_free_hostent(struct hostent *host);
const char *ares_strerror(int code);