[quagga-dev 10236] Re: quagga doesn't detect interface deletion?
nobody at nowhere.ws
Sun Jan 27 22:17:52 GMT 2013
On 01/27/2013 05:11 PM, M. V. wrote:
> thank you David for your reply. I checked the patch, and it's apparently cleaning "show running-config" and "write" output. but I think it's better if on interface deletion, it's completely being removed from all related structures in all daemons.
> with my little knowledge of quagga source-code, I think kernel_socket.c is responsible for doing this(?). (I had a quick test and saw if an interface is being added or deleted, "ifan_read" is being called, and if I delete an interface from system (with ifconfig), in "ifan_read" function, next condition gets true:
> else if (ifp != NULL && ifan_what == IFAN_DEPARTURE)
> and this calls "if_delete_update(ifp)", but I don't know why this doesn't delete interfaces. (i tried if_delete(ifp) here, but this didn't delete interface either.)
> shouldn't this section of code deletes interface from zebra and then tells deletion to other daemons? doesn't anyone know why this isn't happening and what changes could do the trick?
> thank you.
While it may be suitable to delete the interface structure in your
specific case, it is not suitable to delete it in every case.
This is because the interface structure is not only used to contain
information about the kernel state concerning that interface, but e.g.
in zebra, it contains a list of IP addresses zebra should configure on
that interface, while in ospfd, it e.g. contains the configured
interface cost, hello interval etc.
Now imagine the interface is a VPN interface that becomes available or
is deleted from time to time, then you definitively don't want to delete
the interface structure from Zebra and all daemons when it's deleted
from the kernel. Therefore, the interface structure is still kept around
to contain these settings, even when the kernel interface is deleted.
What the patch does is, it simply won't print those interfaces which are
kept around if there isn't any remarkable configuration on them.
In theory, when an interface is deleted from the kernel, it should be
possible to delete its structure after verifying that it doesn't contain
interesting configuration data. I just think that this is not
implemented as it is a special case and would need to be determined for
each Quagga daemon separately. Also, it seems to me that such a check
would be prone to contain interesting bugs without very much benefit.
More information about the Quagga-dev