Skip to content

Commit 2fe30c1

Browse files
committed
merge revision(s) 44638: [Backport ruby#9350]
* 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 ruby#9350] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 54c00c0 commit 2fe30c1

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Thu Feb 20 10:19:40 2014 Tanaka Akira <akr@fsij.org>
2+
3+
* ext/socket/option.c: IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket
4+
option takes a byte on OpenBSD.
5+
Fixed by Jeremy Evans. [ruby-core:59496] [Bug #9350]
6+
17
Wed Feb 19 15:25:13 2014 Koichi Sasada <ko1@atdot.net>
28

39
* gc.c (ruby_gc_set_params): don't show obsolete warnings for

ext/socket/option.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ static VALUE
357357
sockopt_s_ipv4_multicast_loop(VALUE klass, VALUE value)
358358
{
359359
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_LOOP)
360-
# ifdef __NetBSD__
360+
# if defined(__NetBSD__) || defined(__OpenBSD__)
361361
unsigned char i = NUM2CHR(rb_to_int(value));
362362
# else
363363
int i = NUM2INT(rb_to_int(value));
@@ -387,7 +387,7 @@ sockopt_ipv4_multicast_loop(VALUE self)
387387

388388
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_LOOP)
389389
if (family == AF_INET && level == IPPROTO_IP && optname == IP_MULTICAST_LOOP) {
390-
# ifdef __NetBSD__
390+
# if defined(__NetBSD__) || defined(__OpenBSD__)
391391
return sockopt_byte(self);
392392
# else
393393
return sockopt_int(self);
@@ -398,7 +398,7 @@ sockopt_ipv4_multicast_loop(VALUE self)
398398
UNREACHABLE;
399399
}
400400

401-
#ifdef __NetBSD__
401+
#if defined(__NetBSD__) || defined(__OpenBSD__)
402402
# define inspect_ipv4_multicast_loop(a,b,c,d) inspect_byte(a,b,c,d)
403403
#else
404404
# define inspect_ipv4_multicast_loop(a,b,c,d) inspect_int(a,b,c,d)
@@ -420,7 +420,7 @@ static VALUE
420420
sockopt_s_ipv4_multicast_ttl(VALUE klass, VALUE value)
421421
{
422422
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_TTL)
423-
# ifdef __NetBSD__
423+
# if defined(__NetBSD__) || defined(__OpenBSD__)
424424
unsigned char i = NUM2CHR(rb_to_int(value));
425425
# else
426426
int i = NUM2INT(rb_to_int(value));
@@ -450,7 +450,7 @@ sockopt_ipv4_multicast_ttl(VALUE self)
450450

451451
#if defined(IPPROTO_IP) && defined(IP_MULTICAST_TTL)
452452
if (family == AF_INET && level == IPPROTO_IP && optname == IP_MULTICAST_TTL) {
453-
# ifdef __NetBSD__
453+
# if defined(__NetBSD__) || defined(__OpenBSD__)
454454
return sockopt_byte(self);
455455
# else
456456
return sockopt_int(self);
@@ -461,7 +461,7 @@ sockopt_ipv4_multicast_ttl(VALUE self)
461461
UNREACHABLE;
462462
}
463463

464-
#ifdef __NetBSD__
464+
#if defined(__NetBSD__) || defined(__OpenBSD__)
465465
# define inspect_ipv4_multicast_ttl(a,b,c,d) inspect_byte(a,b,c,d)
466466
#else
467467
# 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)
481481
}
482482
}
483483

484-
#ifdef __NetBSD__
484+
#if defined(__NetBSD__) || defined(__OpenBSD__)
485485
static int
486486
inspect_byte(int level, int optname, VALUE data, VALUE ret)
487487
{

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.1.1"
22
#define RUBY_RELEASE_DATE "2014-02-20"
3-
#define RUBY_PATCHLEVEL 35
3+
#define RUBY_PATCHLEVEL 36
44

55
#define RUBY_RELEASE_YEAR 2014
66
#define RUBY_RELEASE_MONTH 2

0 commit comments

Comments
 (0)