> In the current kernels I see that all routes are deleted when
> a device goes down (!IFF_UP -> NETDEV_DOWN).
> I can't find a place
> where the proto static routes are used.
proto is not used by kernel (except for marking routes created
by itself with proto "kernel"), it is used by routing daemons,
> So, I implemented a way to make the proto static routes permanent.
Not so bad idea. Only pretty useless one, gated and brothers do this nicely.
Implementation is wrong, but you will get this effect using code under
#ifdef CONFIG_IP_ROUTE_MULTIPATH for normal routes.
> kernel(s). It is for 2.2 and can be ported to 2.4 too. How these RTPROT
> codes are really used in the routing daemons and do they use static
> routes too?
Look into gated manual, it explains diffrence of routes with
RTF_STATIC (BSD term).
> What I see as problem even in the plain 2.2.19 kernel is that
> when one device for one of the nexthops (when the prefsrc is not from
> this device) is removed and
Sorry, you did something wrong here. On unregister you must destroy all the
references to this device. Being unregistered, the device disappears
forever and cannot return.
> added again it can receive another dev index
Full non-sense. "This" device cannot get another index, index
is the only thing distinguishing devices.
> The patch contains a fix in fib_sync_up() about similar problem, i.e.
> not to touch nh_dev for DEAD routes.
Do not leave undefined crap there, that's answer. :-)