* 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:
parent
24a52978d4
commit
57b2190d55
@ -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>
|
Sat Jan 18 21:19:04 2014 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* lib/open-uri.rb: Make proxy disabling working again.
|
* lib/open-uri.rb: Make proxy disabling working again.
|
||||||
|
@ -357,7 +357,7 @@ static VALUE
|
|||||||
sockopt_s_ipv4_multicast_loop(VALUE klass, VALUE value)
|
sockopt_s_ipv4_multicast_loop(VALUE klass, VALUE value)
|
||||||
{
|
{
|
||||||
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_LOOP)
|
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_LOOP)
|
||||||
# ifdef __NetBSD__
|
# if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
unsigned char i = NUM2CHR(rb_to_int(value));
|
unsigned char i = NUM2CHR(rb_to_int(value));
|
||||||
# else
|
# else
|
||||||
int i = NUM2INT(rb_to_int(value));
|
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 defined(IPPROTO_IP) && defined(IP_MULTICAST_LOOP)
|
||||||
if (family == AF_INET && level == IPPROTO_IP && optname == 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);
|
return sockopt_byte(self);
|
||||||
# else
|
# else
|
||||||
return sockopt_int(self);
|
return sockopt_int(self);
|
||||||
@ -398,7 +398,7 @@ sockopt_ipv4_multicast_loop(VALUE self)
|
|||||||
UNREACHABLE;
|
UNREACHABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __NetBSD__
|
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
# define inspect_ipv4_multicast_loop(a,b,c,d) inspect_byte(a,b,c,d)
|
# define inspect_ipv4_multicast_loop(a,b,c,d) inspect_byte(a,b,c,d)
|
||||||
#else
|
#else
|
||||||
# define inspect_ipv4_multicast_loop(a,b,c,d) inspect_int(a,b,c,d)
|
# 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)
|
sockopt_s_ipv4_multicast_ttl(VALUE klass, VALUE value)
|
||||||
{
|
{
|
||||||
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_TTL)
|
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_TTL)
|
||||||
# ifdef __NetBSD__
|
# if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
unsigned char i = NUM2CHR(rb_to_int(value));
|
unsigned char i = NUM2CHR(rb_to_int(value));
|
||||||
# else
|
# else
|
||||||
int i = NUM2INT(rb_to_int(value));
|
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 defined(IPPROTO_IP) && defined(IP_MULTICAST_TTL)
|
||||||
if (family == AF_INET && level == IPPROTO_IP && optname == 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);
|
return sockopt_byte(self);
|
||||||
# else
|
# else
|
||||||
return sockopt_int(self);
|
return sockopt_int(self);
|
||||||
@ -461,7 +461,7 @@ sockopt_ipv4_multicast_ttl(VALUE self)
|
|||||||
UNREACHABLE;
|
UNREACHABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __NetBSD__
|
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
# define inspect_ipv4_multicast_ttl(a,b,c,d) inspect_byte(a,b,c,d)
|
# define inspect_ipv4_multicast_ttl(a,b,c,d) inspect_byte(a,b,c,d)
|
||||||
#else
|
#else
|
||||||
# define inspect_ipv4_multicast_ttl(a,b,c,d) inspect_int(a,b,c,d)
|
# 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
|
static int
|
||||||
inspect_byte(int level, int optname, VALUE data, VALUE ret)
|
inspect_byte(int level, int optname, VALUE data, VALUE ret)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user