[quagga-dev 3586] Re: Patch to fix multicast problem on FreeBSD 5.x

Nate Nielsen nielsen-list at memberwebs.com
Wed Aug 17 01:13:16 BST 2005

Greg Troxel wrote:
> 2) In the case where add returns EADDRINUSE, the code does a DROP/ADD
>    pair.  If the error was due to a stale join on the same socket,
>    this would seem to do nothing.  If it's due to another socket,
>    you'll still get an error.

And if it's another socket (and hence another process, and OSPF
implementation running) then we would want to get EADDRINUSE.

Just to confirm, this does fix the problem on FreeBSD, and allows an
interface (let's say a tun interface) to go down and back up and have
ospfd rejoin on that interface.

> I wonder about keeping a flag in user space representing the state of
> join/leave for the group, and doing a drop first if it is recorded as
> joined.  The problem here is if an interface is taken down and another
> is brought up with the same address.  So really I think problem (1)
> needs to be fixed.

Yes, but in any case it probably won't be backported to already running
versions of FreeBSD, in which case the faulty behavior (pretty big deal
IMO) will still exist there.

> In your case, does the interface still have the address, and what
> error do you get on the failed IP_DROP_MEMBERSHIP?

This was my first approach to solving the problem: To just force it to
do IP_DROP_MEMBERSHIP on the DOWN interface. I patch ospfd to this end.
However setsockopt_multicast_ipv4 would fail with something like EINVAL.

This whole setup is at one of my client's places, I've fixed 3 or 4 bugs
in quagga and am looking to contribute these back to the community one
by one.

If you'd like me to get the specific failure codes etc... then I would
need to wait until I visit back there, probably some time next week.

> NetBSD supports specifying interfaces by ifindex, and I'm 99% sure
> FreeBSD has done this for a while.  Last I checked, Quagga didn't use
> this on BSD, and doing so might help in finding an interface on drop
> if the address is gone.

What would the call look like? I can check this out if you send me a patch.


More information about the Quagga-dev mailing list