* ext/socket/option.c: IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket

option takes a byte on OpenBSD.
  Fixed by Jeremy Evans.  [ruby-core:59496] [Bug #9350]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2014-01-18 12:31:57 +00:00
Родитель 24a52978d4
Коммит 57b2190d55
2 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Sat Jan 18 21:24:49 2014 Tanaka Akira <akr@fsij.org>
* ext/socket/option.c: IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket
option takes a byte on OpenBSD.
Fixed by Jeremy Evans. [ruby-core:59496] [Bug #9350]
Sat Jan 18 21:19:04 2014 Tanaka Akira <akr@fsij.org>
* lib/open-uri.rb: Make proxy disabling working again.

Просмотреть файл

@ -357,7 +357,7 @@ static VALUE
sockopt_s_ipv4_multicast_loop(VALUE klass, VALUE value)
{
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_LOOP)
# ifdef __NetBSD__
# if defined(__NetBSD__) || defined(__OpenBSD__)
unsigned char i = NUM2CHR(rb_to_int(value));
# else
int i = NUM2INT(rb_to_int(value));
@ -387,7 +387,7 @@ sockopt_ipv4_multicast_loop(VALUE self)
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_LOOP)
if (family == AF_INET && level == IPPROTO_IP && optname == IP_MULTICAST_LOOP) {
# ifdef __NetBSD__
# if defined(__NetBSD__) || defined(__OpenBSD__)
return sockopt_byte(self);
# else
return sockopt_int(self);
@ -398,7 +398,7 @@ sockopt_ipv4_multicast_loop(VALUE self)
UNREACHABLE;
}
#ifdef __NetBSD__
#if defined(__NetBSD__) || defined(__OpenBSD__)
# define inspect_ipv4_multicast_loop(a,b,c,d) inspect_byte(a,b,c,d)
#else
# define inspect_ipv4_multicast_loop(a,b,c,d) inspect_int(a,b,c,d)
@ -420,7 +420,7 @@ static VALUE
sockopt_s_ipv4_multicast_ttl(VALUE klass, VALUE value)
{
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_TTL)
# ifdef __NetBSD__
# if defined(__NetBSD__) || defined(__OpenBSD__)
unsigned char i = NUM2CHR(rb_to_int(value));
# else
int i = NUM2INT(rb_to_int(value));
@ -450,7 +450,7 @@ sockopt_ipv4_multicast_ttl(VALUE self)
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_TTL)
if (family == AF_INET && level == IPPROTO_IP && optname == IP_MULTICAST_TTL) {
# ifdef __NetBSD__
# if defined(__NetBSD__) || defined(__OpenBSD__)
return sockopt_byte(self);
# else
return sockopt_int(self);
@ -461,7 +461,7 @@ sockopt_ipv4_multicast_ttl(VALUE self)
UNREACHABLE;
}
#ifdef __NetBSD__
#if defined(__NetBSD__) || defined(__OpenBSD__)
# define inspect_ipv4_multicast_ttl(a,b,c,d) inspect_byte(a,b,c,d)
#else
# define inspect_ipv4_multicast_ttl(a,b,c,d) inspect_int(a,b,c,d)
@ -481,7 +481,7 @@ inspect_int(int level, int optname, VALUE data, VALUE ret)
}
}
#ifdef __NetBSD__
#if defined(__NetBSD__) || defined(__OpenBSD__)
static int
inspect_byte(int level, int optname, VALUE data, VALUE ret)
{