summaryrefslogtreecommitdiffstats
path: root/sysdep
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-04-14 13:39:07 +0200
committerMartin Mares <mj@ucw.cz>1999-04-14 13:39:07 +0200
commit1b50a1e4be2b54bd4ccadfaeaf558aea15255de4 (patch)
tree28ab461450e26fd716a1777acdedc655f86f63a3 /sysdep
parent36154beb705cdaf03f9ee050798d9e653ded6ca5 (diff)
downloadbird-1b50a1e4be2b54bd4ccadfaeaf558aea15255de4.tar
bird-1b50a1e4be2b54bd4ccadfaeaf558aea15255de4.zip
Next attempt to get SO_BINDTODEVICE work :)
Diffstat (limited to 'sysdep')
-rw-r--r--sysdep/unix/io.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 02de2fa..f5e3124 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -16,6 +16,10 @@
#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)