1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/socket/extconf.rb: check s6_addr8 in in6_addr (Tru64 UNIX).

the patch is submitted by nmu <nmu@users.sourceforge.jp>.

* ext/socket/getaddrinfo.c (getaddrinfo): should use in6_addr8 on
  some platforms.

* ext/socket/getnameinfo.c (getnameinfo): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-09-02 05:12:39 +00:00
parent 9388ed284d
commit 05bb6b505c
4 changed files with 38 additions and 2 deletions

View file

@ -1,3 +1,13 @@
Tue Sep 2 14:09:20 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/socket/extconf.rb: check s6_addr8 in in6_addr (Tru64 UNIX).
the patch is submitted by nmu <nmu@users.sourceforge.jp>.
* ext/socket/getaddrinfo.c (getaddrinfo): should use in6_addr8 on
some platforms.
* ext/socket/getnameinfo.c (getnameinfo): ditto.
Tue Sep 2 14:02:19 2003 <nagai@ai.kyutech.ac.jp> Tue Sep 2 14:02:19 2003 <nagai@ai.kyutech.ac.jp>
* ext/tcltklib/tcltklib.c (ip_invoke): fixed bug on passing a exception * ext/tcltklib/tcltklib.c (ip_invoke): fixed bug on passing a exception
@ -141,8 +151,8 @@ Thu Aug 28 17:30:24 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
included modules, if klass is Object. [ruby-talk:79302] included modules, if klass is Object. [ruby-talk:79302]
* numeric.c (check_uint): check should be done using UINT_MAX, not * numeric.c (check_uint): check should be done using UINT_MAX, not
INT_MAX. this fix is submitted by <lyle@knology.net> in INT_MAX. this fix is submitted by Lyle Johnson
[ruby-core:01486] <lyle@knology.net> in [ruby-core:01486]
Thu Aug 28 05:02:52 2003 Yukihiro Matsumoto <matz@ruby-lang.org> Thu Aug 28 05:02:52 2003 Yukihiro Matsumoto <matz@ruby-lang.org>

View file

@ -321,6 +321,24 @@ $objs = ["socket.#{$OBJEXT}"]
if $getaddr_info_ok and have_func("getaddrinfo") and have_func("getnameinfo") if $getaddr_info_ok and have_func("getaddrinfo") and have_func("getnameinfo")
have_getaddrinfo = true have_getaddrinfo = true
else
if try_link(<<EOF)
#include <sys/types.h>
#include <netdb.h>
#include <string.h>
#include <sys/socket.h>
#include <netinet/in.h>
int
main()
{
struct in6_addr addr;
unsigned char c;
c = addr.s6_addr8;
return 0;
}
EOF
$CFLAGS="-DHAVE_ADDR8 "+$CFLAGS
end
end end
if have_getaddrinfo if have_getaddrinfo

View file

@ -480,7 +480,11 @@ getaddrinfo(hostname, servname, hints, res)
break; break;
#ifdef INET6 #ifdef INET6
case AF_INET6: case AF_INET6:
#ifdef HAVE_ADDR8
pfx = ((struct in6_addr *)pton)->s6_addr8[0]; pfx = ((struct in6_addr *)pton)->s6_addr8[0];
#else
pfx = ((struct in6_addr *)pton)->s6_addr[0];
#endif
if (pfx == 0 || pfx == 0xfe || pfx == 0xff) if (pfx == 0 || pfx == 0xfe || pfx == 0xff)
pai->ai_flags &= ~AI_CANONNAME; pai->ai_flags &= ~AI_CANONNAME;
break; break;

View file

@ -208,7 +208,11 @@ getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
break; break;
#ifdef INET6 #ifdef INET6
case AF_INET6: case AF_INET6:
#ifdef HAVE_ADDR8
pfx = ((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr8[0]; pfx = ((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr8[0];
#else
pfx = ((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr[0];
#endif
if (pfx == 0 || pfx == 0xfe || pfx == 0xff) if (pfx == 0 || pfx == 0xfe || pfx == 0xff)
flags |= NI_NUMERICHOST; flags |= NI_NUMERICHOST;
break; break;