[前][次][番号順一覧][スレッド一覧]

ruby-changes:32559

From: akr <ko1@a...>
Date: Sat, 18 Jan 2014 21:32:01 +0900 (JST)
Subject: [ruby-changes:32559] akr:r44638 (trunk): * ext/socket/option.c: IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket

akr	2014-01-18 21:31:57 +0900 (Sat, 18 Jan 2014)

  New Revision: 44638

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44638

  Log:
    * 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]

  Modified files:
    trunk/ChangeLog
    trunk/ext/socket/option.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 44637)
+++ ChangeLog	(revision 44638)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jan 18 21:24:49 2014  Tanaka Akira  <akr@f...>
+
+	* 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@f...>
 
 	* lib/open-uri.rb: Make proxy disabling working again.
Index: ext/socket/option.c
===================================================================
--- ext/socket/option.c	(revision 44637)
+++ ext/socket/option.c	(revision 44638)
@@ -357,7 +357,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/ext/socket/option.c#L357
 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) https://github.com/ruby/ruby/blob/trunk/ext/socket/option.c#L387
 
 #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) https://github.com/ruby/ruby/blob/trunk/ext/socket/option.c#L398
     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 https://github.com/ruby/ruby/blob/trunk/ext/socket/option.c#L420
 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) https://github.com/ruby/ruby/blob/trunk/ext/socket/option.c#L450
 
 #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) https://github.com/ruby/ruby/blob/trunk/ext/socket/option.c#L461
     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, VALU https://github.com/ruby/ruby/blob/trunk/ext/socket/option.c#L481
     }
 }
 
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined(__OpenBSD__)
 static int
 inspect_byte(int level, int optname, VALUE data, VALUE ret)
 {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]