Commit 4c5e5e3a authored by Martin Mareš's avatar Martin Mareš
Browse files

Multicasts once again: When using SO_BINDTODEVICE, don't specify IP address

of the interface.
parent 1b50a1e4
......@@ -422,16 +422,17 @@ sk_open(sock *s)
struct ip_mreq mreq_add;
set_inaddr(&mreq, s->iface->ip);
mreq_add.imr_interface = mreq;
struct ifreq ifr;
strcpy(ifr.ifr_name, s->iface->name);
if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)) < 0)
mreq_add.imr_interface.s_addr = INADDR_ANY;
#error Multicasts not supported on PtP devices /* FIXME: Solve it somehow? */
mreq_add.imr_interface = mreq;
set_inaddr(&mreq_add.imr_multiaddr, s->daddr);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment