Linux gateway detection does not respect flags
|Reported by:||samuli||Owned by:|
|Component:||Networking||Version:||2.1.0 / 2.1.1|
|Severity:||Not set (if unsure, select this one)||Keywords:||gateway linux|
Description (last modified by samuli)
In route.c::get_default_gateway, the /proc/net/route file is examined.
One of the fields is the "FLAGS" field which contiain various status flags about a route. Because OpenVPN does not evaluate the flags field, it may find an invalid gateway entry with (Flags & RTNH_F_DEAD == 0).
At least valid with Kernel-2.4, e.g. "ip r del default" does not delete the entry from /proc/net/route, instead it's marked dead. May be true with Kernel-2.6 also, e.g. with the "dead gateway detection": if 2 gw's with same metric exist, this semi-automatically switches from a dead gw to a functioning one. I presume this is done by marking with Flags, but I haven't checked that.