Next attempt to get SO_BINDTODEVICE work :)
This commit is contained in:
parent
36154beb70
commit
1b50a1e4be
1 changed files with 10 additions and 6 deletions
|
@ -16,6 +16,10 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#ifndef HAVE_STRUCT_IP_MREQN
|
||||||
|
#include <net/if.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "nest/bird.h"
|
#include "nest/bird.h"
|
||||||
#include "lib/lists.h"
|
#include "lib/lists.h"
|
||||||
#include "lib/resource.h"
|
#include "lib/resource.h"
|
||||||
|
@ -413,6 +417,12 @@ sk_open(sock *s)
|
||||||
ASSERT(s->iface);
|
ASSERT(s->iface);
|
||||||
mreq.imr_ifindex = s->iface->index;
|
mreq.imr_ifindex = s->iface->index;
|
||||||
set_inaddr(&mreq.imr_address, s->iface->ip);
|
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
|
#ifdef SO_BINDTODEVICE
|
||||||
{
|
{
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
|
@ -423,12 +433,6 @@ sk_open(sock *s)
|
||||||
#else
|
#else
|
||||||
#error Multicasts not supported on PtP devices /* FIXME: Solve it somehow? */
|
#error Multicasts not supported on PtP devices /* FIXME: Solve it somehow? */
|
||||||
#endif
|
#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
|
#endif
|
||||||
set_inaddr(&mreq_add.imr_multiaddr, s->daddr);
|
set_inaddr(&mreq_add.imr_multiaddr, s->daddr);
|
||||||
if (has_dest)
|
if (has_dest)
|
||||||
|
|
Loading…
Reference in a new issue