]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Multicasts once again: When using SO_BINDTODEVICE, don't specify IP address
authorMartin Mares <mj@ucw.cz>
Wed, 14 Apr 1999 12:29:47 +0000 (12:29 +0000)
committerMartin Mares <mj@ucw.cz>
Wed, 14 Apr 1999 12:29:47 +0000 (12:29 +0000)
of the interface.

sysdep/unix/io.c

index f5e3124c30dad3df7ccde25cc52cc486c4fcf9f0..7764d3dfee29dd68a29534b060b286336b6e0107 100644 (file)
@@ -422,16 +422,17 @@ sk_open(sock *s)
        struct ip_mreq mreq_add;
        ASSERT(s->iface);
        set_inaddr(&mreq, s->iface->ip);
-       mreq_add.imr_interface = mreq;
 #ifdef SO_BINDTODEVICE
        {
          struct ifreq ifr;
          strcpy(ifr.ifr_name, s->iface->name);
          if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, &ifr, sizeof(ifr)) < 0)
            ERR("SO_BINDTODEVICE");
+         mreq_add.imr_interface.s_addr = INADDR_ANY;
        }
 #else
 #error Multicasts not supported on PtP devices         /* FIXME: Solve it somehow? */
+       mreq_add.imr_interface = mreq;
 #endif
 #endif
        set_inaddr(&mreq_add.imr_multiaddr, s->daddr);