[quagga-dev 8378] Re: Removal of interfaces doesn't delete routes

Stephen Hemminger shemminger at vyatta.com
Tue Nov 30 16:51:45 GMT 2010


On Tue, 30 Nov 2010 17:35:58 +0100
Daniel Fahlgren <fahlgren at tutus.se> wrote:

> Hi,
> 
> I have discovered that Quagga isn't removing routes that are connected
> to an interface when the interface is removed. If you have a usb network
> card and have an extra route via that will that route be left in Quagga
> if the card is removed. I have a usb network card that is recognized as
> eth1. If I run
> 
>         ifconfig eth1 192.168.0.2 netmask 255.255.255.0 up
>         route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.168.0.1
> 
> will I have the following route in Quagga after I unplug the network
> card (without first removing the routes and the interface):
> 
>         K * 192.168.10.0/24 via 192.168.0.1, unknown inactive
> 
> This is tested with Ubuntu 10.10 and Quagga from a git checkout.
> 
> This can also be tested with tun devices if you don't have access to a
> network card that you can unplug.
>         
>         tunctl -t tun0
>         ifconfig tun0 192.168.0.2 netmask 255.255.255.0 up
>         route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.168.0.1
>         tunctl -d tun0
> 
> It doesn't seems like it get a notification that the kernel is removing
> this route. The attached patch tries to fix it by iterating over any
> route that is connected to this interface, but it doesn't handle ipv6
> etc.
> 
> How and where should these routes be removed?

The RIB update code in stock Quagga doesn't work well.
I put a lot of fixes in the Vyatta version, and submitted most
of the patches; but they seem to have gotten lost and never applied.
Part of the "some day we will rewrite the RIB and all will work" myth.




More information about the Quagga-dev mailing list