On 24/09/15(Thu) 15:46, Stuart Henderson wrote: > On 2015/09/13 11:15, Martin Pieuchot wrote: > > Currently we leave RTF_STATIC route entries in the table when the > > address they are attached to is removed from a system. > > > > That's why ifas need to be refcounted and that's why we have *a lot* > > of checks in the stack to not use cached routes attached to such ifa. > > > > I'd like to simplify all of this by simply purging all the routes > > attached to an ifa being removed. This behavior is coherent with > > the fact that routes *need* an ifa to be inserted in the table. > > > > This makes the kernel simpler as it no longer try to find a new ifa > > when a route with a stale address is being used. > > This does bad things with pppoe(4) default routes, the usual way to > configure this is with a wildcard 0.0.0.0 in hostname.pppoe0 and with > default pointing with -ifp pppoe0. > > I'm not 100% sure about this but I guess that when IPCP negotiates > an address and removes the temporary 0.0.0.0 wildcard address to > configure it on the interface, the default -ifp route is also killed.
I just sent a new diff that works with this hack. I'll polish the turd afterward to make it clear that in_ifinit() should only be called to update an address because of IPCP negotiation.