gsocket: Use alternate IPv6 multicast group sockopt names
authorDan Winship <danw@gnome.org>
Mon, 16 Jan 2012 22:15:06 +0000 (17:15 -0500)
committerDan Winship <danw@gnome.org>
Mon, 16 Jan 2012 22:16:40 +0000 (17:16 -0500)
Apparently IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP are more portable than
IPV6_ADD_MEMBERSHIP and IPV6_DROP_MEMBERSHIP. (Windows and Linux have
both, but OS X only has the latter.)

gio/gsocket.c

index 05ad39b..bce38f5 100644 (file)
@@ -1950,7 +1950,7 @@ g_socket_multicast_group_operation (GSocket       *socket,
       else
         mc_req_ipv6.ipv6mr_interface = 0;
 
-      optname = join_group ? IPV6_ADD_MEMBERSHIP : IPV6_DROP_MEMBERSHIP;
+      optname = join_group ? IPV6_JOIN_GROUP : IPV6_LEAVE_GROUP;
       result = setsockopt (socket->priv->fd, IPPROTO_IPV6, optname,
                           &mc_req_ipv6, sizeof (mc_req_ipv6));
     }