]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Next attempt to get SO_BINDTODEVICE work :)
authorMartin Mares <mj@ucw.cz>
Wed, 14 Apr 1999 11:39:07 +0000 (11:39 +0000)
committerMartin Mares <mj@ucw.cz>
Wed, 14 Apr 1999 11:39:07 +0000 (11:39 +0000)
sysdep/unix/io.c

index 02de2fa75601af308eef1d2934ef3e471b7c22e2..f5e3124c30dad3df7ccde25cc52cc486c4fcf9f0 100644 (file)
 #include <unistd.h>
 #include <errno.h>
 
+#ifndef HAVE_STRUCT_IP_MREQN
+#include <net/if.h>
+#endif
+
 #include "nest/bird.h"
 #include "lib/lists.h"
 #include "lib/resource.h"
@@ -413,6 +417,12 @@ sk_open(sock *s)
        ASSERT(s->iface);
        mreq.imr_ifindex = s->iface->index;
        set_inaddr(&mreq.imr_address, s->iface->ip);
+#else
+       struct in_addr mreq;
+       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;
@@ -423,12 +433,6 @@ sk_open(sock *s)
 #else
 #error Multicasts not supported on PtP devices         /* FIXME: Solve it somehow? */
 #endif
-#else
-       struct in_addr mreq;
-       struct ip_mreq mreq_add;
-       ASSERT(s->iface);
-       set_inaddr(&mreq, s->iface->ip);
-       mreq_add.imr_interface = mreq;
 #endif
        set_inaddr(&mreq_add.imr_multiaddr, s->daddr);
        if (has_dest)