summaryrefslogtreecommitdiff
path: root/network_io
diff options
context:
space:
mode:
authorjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-03-06 18:13:11 +0000
committerjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-03-06 18:13:11 +0000
commit60151c0aa0b8f390a3656582ba4f7826f499431d (patch)
treebd0505a9f60af16b7caa6fc4f303b344cd196507 /network_io
parent5e7946d0635aa644fdde0e2399a297040e2ba97d (diff)
downloadlibapr-60151c0aa0b8f390a3656582ba4f7826f499431d.tar.gz
Backport from HEAD:
* network_io/sockets/sockaddr.c (call_resolver): Ignore anything other than AF_INET and AF_INET6 addresses. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/APR_0_9_BRANCH@64940 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io')
-rw-r--r--network_io/unix/sockaddr.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c
index 9f89d4453..281c89d9f 100644
--- a/network_io/unix/sockaddr.c
+++ b/network_io/unix/sockaddr.c
@@ -380,7 +380,17 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa,
prev_sa = NULL;
ai = ai_list;
while (ai) { /* while more addresses to report */
- apr_sockaddr_t *new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t));
+ apr_sockaddr_t *new_sa;
+
+ /* Ignore anything bogus: getaddrinfo in some old versions of
+ * glibc will return AF_UNIX entries for AF_UNSPEC+AI_PASSIVE
+ * lookups. */
+ if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) {
+ ai = ai->ai_next;
+ continue;
+ }
+
+ new_sa = apr_pcalloc(p, sizeof(apr_sockaddr_t));
new_sa->pool = p;
memcpy(&new_sa->sa, ai->ai_addr, ai->ai_addrlen);