HEADSUP: arp-v2 has been committed
ianf at clue.co.za
Tue Dec 23 05:50:18 UTC 2008
Sergey Matveychuk wrote:
> Ian FREISLICH wrote:
> > --- lib/sockopt.c.orig 2007-08-21 18:32:56.000000000 +0200
> > +++ lib/sockopt.c 2008-08-13 09:07:20.000000000 +0200
> > @@ -231,6 +231,7 @@
> > else
> > mreqn.imr_address = if_addr;
> > + mreqn.imr_address = if_addr;
> > ret = setsockopt(sock, IPPROTO_IP, optname,
> > (void *)&mreqn, sizeof(mreqn));
> > if ((ret < 0) && (optname == IP_ADD_MEMBERSHIP) && (errno == EADDRIN
> I don't catch your idea here. Can you explain it please?
I can't quite remember exactly why imr_ifindex doesn't work, but
on my hosts which have several hundred interfaces and my OSPF
sessions are never on the interface that has the default route,
until I explicitly set the imr_address, the kernel always chooses
the interface which has the default route.
I know the resultant code looks ugly. I've just never had the time
to relook the problem.
Does this look better?
--- sockopt.c.orig 2008-12-23 07:00:24.000000000 +0200
+++ sockopt.c 2008-12-23 07:41:28.000000000 +0200
@@ -227,9 +227,11 @@
mreqn.imr_multiaddr.s_addr = mcast_addr;
+#if OSVERSION > 700001
mreqn.imr_ifindex = ifindex;
mreqn.imr_address = if_addr;
ret = setsockopt(sock, IPPROTO_IP, optname,
More information about the freebsd-current