Removing the route when Ethernet link goes down

Helio Fujimoto (fujima@cyclades.com)
Mon, 4 Nov 2002 12:56:12 -0500


Please answer this e-mail with copy to me, for I am not subscribed to the
list.

I am debugging an Ethernet driver in the kernel 2.4.17, which is able to
recognize when the Ethernet link is up or down. When the link is up, I am
setting the bit IFF_RUNNING to the dev->flag parameter, and when it is down
this bit is reset. Besides this, I am calling the routines netif_carrier_on
and netif_carrier_off, respectively. This makes the interface status change
(when I call ifconfig eth0).

However, the routing table doesn't change when link goes up or down, though
they do change when I set the interface up and down. I couldn't find out what
I could do to make the Ethernet driver work in this way, so that the routes
to the Ethernet link would appear only if the interface was up and running.
Do you have an easy (or maybe difficult) way to do this? Any routine, any
magic?

Thanks in advance,

Helio Fujimoto.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/