Subject: Re: interface destruction issues with multicast membership
To: Greg Troxel <gdt@ir.bbn.com>
From: Matt Thomas <matt@3am-software.com>
List: tech-net
Date: 05/10/2005 14:40:33
Greg Troxel wrote:
>     [handle PRU_PURGEIF in all protocols]
> 
>   I think that is perfectly reasonable. What is the alternative? To have
>   the last interface address removal code handle it?
> 
> I can see either:
> 
>   Purge on last address removal.  This seems like it has to happen on
>   all protocols in a domain, so it has the same issue.  (I don't
>   understand why the panic I got doesn't happen without my change,
>   since I thought all protocols in the domain were called if there was
>   an address in the domain.)  Has a touch of elegance, but I'm not
>   optimistic that such a complicated invariant can be maintained over
>   time as code changes.
> 
>   Have a per-protocol NEEDS_PURGEIF flag, and only invoke the method
>   on such protocols.  But this seems inelegant to me.
> 
> 
> So, I'll start down the path of (not) handling PRU_PURGEIF in \forall
> foo \in protocols: foo_usrreq, and submit a patch with that and the
> new for loop I just sent.

That seem wrong.  The proper solution is to add a PR_PURGEIF flags and
add that to the appropriate protosw entries.

Adding "dead" code is wrong.
-- 
Matt Thomas                     email: matt@3am-software.com
3am Software Foundry              www: http://3am-software.com/bio/matt/
Cupertino, CA              disclaimer: I avow all knowledge of this message.