* ext/socket/option.c: Use "byte" as default argument for

IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket option to follow
  the original multicast implementation.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2014-01-20 15:43:47 +00:00
Родитель 3b8bcf42a7
Коммит 3682c6a327
2 изменённых файлов: 19 добавлений и 4 удалений

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

@ -1,3 +1,9 @@
Tue Jan 21 00:39:15 2014 Tanaka Akira <akr@fsij.org>
* ext/socket/option.c: Use "byte" as default argument for
IP_MULTICAST_LOOP and IP_MULTICAST_TTL socket option to follow
the original multicast implementation.
Mon Jan 20 20:20:27 2014 Tanaka Akira <akr@fsij.org>
* ext/socket/option.c: Use preprocessor macros to avoid repeated

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

@ -7,13 +7,13 @@ VALUE rb_cSockOpt;
#define CAT(x,y) x##y
#define XCAT(x,y) CAT(x,y)
#if defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__linux__) || defined(__FreeBSD__)
# define TYPE_IP_MULTICAST_LOOP int
# define TYPE_IP_MULTICAST_TTL int
#else
# define TYPE_IP_MULTICAST_LOOP byte
# define TYPE_IP_MULTICAST_TTL byte
# define USE_INSPECT_BYTE 1
#else
# define TYPE_IP_MULTICAST_LOOP int
# define TYPE_IP_MULTICAST_TTL int
#endif
static VALUE
@ -590,6 +590,15 @@ inspect_timeval_as_interval(int level, int optname, VALUE data, VALUE ret)
* (MULTICAST 1.2 Release)
* http://www.kohala.com/start/mcast.api.txt
*
* There are 2 socket options which takes a u_char (unsigned char).
*
* IP_MULTICAST_TTL
* IP_MULTICAST_LOOP
*
* However Linux and FreeBSD setsockname accepts int argument
* as well as u_char.
* Thier getsockname returns int.
*
* There are 3 socket options which takes a struct.
*
* IP_MULTICAST_IF: struct in_addr