summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/getaddrinfo.c
diff options
context:
space:
mode:
authorshin <shin@FreeBSD.org>2000-02-10 02:59:50 +0000
committershin <shin@FreeBSD.org>2000-02-10 02:59:50 +0000
commitbf70ca5c10ab771d51b44fdada006c5ec5515f04 (patch)
treedfda42e673026bffc09df760606ced9dab4a35e1 /lib/libc/net/getaddrinfo.c
parent71b17017a34cc8a1346d155debf51f6b57522d11 (diff)
downloadFreeBSD-src-bf70ca5c10ab771d51b44fdada006c5ec5515f04.zip
FreeBSD-src-bf70ca5c10ab771d51b44fdada006c5ec5515f04.tar.gz
Let getaddrinfo() and related functions supports traditional IPv4 format
(shortend format, etc) Current KAME getaddrinfo() supports only d.d.d.d format IPv4 addr. But traditionally inet_aton() and etc support other formats. (shortend format and octal/deciaml/hex format) Aboud this, -As far as the discussion on freebsd-current, many people think traditional format should also be supported by getaddrinfo(). -X/Open spec requires getaddrinfo() also support those traditional IPv4 format. -RFC2553 say nothing about it. -As the result of confirmation in ietf/ipng list, there is no clear concensus yet, and the reply was, "RFC2553 update and X/Open spec will be in sync" So takeing these conditions into account, I think getaddrinfo() should also support traditional IPv4 format. Specified by: Marc Schneiders <marc@oldserver.demon.nl> Approved by: jkh
Diffstat (limited to 'lib/libc/net/getaddrinfo.c')
-rw-r--r--lib/libc/net/getaddrinfo.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index 125ea69..8b6d6b7 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -635,7 +635,9 @@ explore_numeric(pai, hostname, servname, res)
return 0;
flags = pai->ai_flags;
- if (inet_pton(afd->a_af, hostname, pton) == 1) {
+ if ((afd->a_af == AF_INET
+ ? inet_aton(hostname, (struct in_addr *)pton)
+ : inet_pton(afd->a_af, hostname, pton)) == 1) {
if (pai->ai_family == afd->a_af ||
pai->ai_family == PF_UNSPEC /*?*/) {
GET_AI(cur->ai_next, afd, pton);
OpenPOWER on IntegriCloud