Initialize the structure passed to setsockopt to 0 to avoid random
errors when joining or leaving a multicast group.
https://bugzilla.gnome.org/show_bug.cgi?id=688378
struct ip_mreq mc_req;
#endif
+ memset (&mc_req, 0, sizeof (mc_req));
memcpy (&mc_req.imr_multiaddr, native_addr, sizeof (struct in_addr));
#ifdef HAVE_IP_MREQN
{
struct ipv6_mreq mc_req_ipv6;
+ memset (&mc_req_ipv6, 0, sizeof (mc_req_ipv6));
memcpy (&mc_req_ipv6.ipv6mr_multiaddr, native_addr, sizeof (struct in6_addr));
#ifdef HAVE_IF_NAMETOINDEX
if (iface)