Skip to content

Commit 4ea9d62

Browse files
committed
*) On z/OS, apr_sockaddr_info_get() with family == APR_UNSPEC was not
returning IPv4 addresses if any IPv6 addresses were returned. [Eric Covener] git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1634615 13f79535-47bb-0310-9956-ffa450edef68
1 parent 31c64f6 commit 4ea9d62

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
-*- coding: utf-8 -*-
22
Changes for APR 2.0.0
33

4+
*) On z/OS, apr_sockaddr_info_get() with family == APR_UNSPEC was not
5+
returning IPv4 addresses if any IPv6 addresses were returned.
6+
[Eric Covener]
7+
48
*) apr_skiplist: Fix potential corruption of skiplists leading to
59
unexpected results or crashes.
610
[Takashi Sato <takashi tks st>, Eric Covener] PR 56654.

network_io/unix/sockaddr.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,16 @@ static apr_status_t call_resolver(apr_sockaddr_t **sa,
333333
hints.ai_flags = AI_ADDRCONFIG;
334334
}
335335
#endif
336+
337+
#ifdef __MVS__
338+
/* z/OS will not return IPv4 address under AF_UNSPEC if any IPv6 results
339+
* are returned, w/o AI_ALL.
340+
*/
341+
if (family == APR_UNSPEC) {
342+
hints.ai_flags |= AI_ALL;
343+
}
344+
#endif
345+
336346
if(hostname == NULL) {
337347
#ifdef AI_PASSIVE
338348
/* If hostname is NULL, assume we are trying to bind to all

0 commit comments

Comments
 (0)