Subject: Re: multicast groups on unnumbered interfaces?
To: Matt Thomas <matt@3am-software.com>
From: Nick Amato <naamato@nexthop.com>
List: tech-net
Date: 10/22/2002 15:55:35
On Wed, Sep 25, 2002 at 09:53:09PM -0700, Matt Thomas wrote:
> At 02:31 PM 9/25/2002, Nick Amato wrote:
> 
> >Is there a good reason why we can't join multicast groups on interfaces
> >that have no address?  It doesn't seem like inm_ia in struct in_multi
> >is used by much of anything.
> >
> >There seems to be some kludge code to store multicast addresses
> >on interfaces that have lost their last IPv[46] address, for later
> >restoration when an interface regains one.
> >
> >Yet, in_addmulti() in in.c does not allow for a multicast group to be added
> >to an interface that does not have an address:
> >
> >                 IFP_TO_IA(ifp, ia);
> >                 if (ia == NULL) {
> >                         free(inm, M_IPMADDR);
> >                         splx(s);
> >                         return (NULL);
> >                 }
> >
> >The IP_ADD_MEMBERSHIP code allows the interface index to be given
> >using the 0/8 hack, but the code above does not let it work.
> 
> The above is why I recoded multicasts to not hang off the ifaddr but
> have their own hash table like the normal address table.  It also scales
> better. :)
> 
> It also get rid of the kludge mcast code in in.c which is a definite plus.
> Alas, I can't contribute the code but the above should make it easy for
> someone else to do since it's not that much code.

Using Matt's suggestion, I submitted some patches as kern/18770
that hash multicast addresses in their own table.  This did allow
the kludge code to go away.  Comments welcome.

Nick Amato
naamato@nexthop.com