OSDN Git Service
Fixes for socket options on multicast sockets.
1. Properly pass get/setsockopt the pointer to the socket option instead of the
pointer to the pointer to the option. This was not caught at compile time
because it's a void *.
2. Handle IPv4 multicast addresses on IPv6 sockets. This is important because
current devices create IPv6 sockets by default.
3. Use the proper options for IPv6 multicast (i.e., IPV6_{ADD,DROP}_MEMBERSHIP
instead of IP_{ADD,DROP}_MEMBERSHIP)
4. Use integers instead of bytes when getting or setting the multicast TTL
because that's what the Linux kernel uses.
These fix 10 of the 11 MulticastSocketTest failures. Also, minor changes:
1. Add ifdefd-out logging functions for get/setsockopt.
2. Change all instances of IPPROTO_{IP,IPv6} to SOL_{IP,IPV6} in get/setsockopt
calls. Even though the values are the same (so the code worked), this way is
more correct.
Change-Id: Iea75a523d7e71f0b361a42c0e39d3ef075dc7ff4