NetworkManager/src/platform
Thomas Haller 42ac15c86f route-manager: manage IPv4 device-routes with NMRouteManager
When adding an IPv4 address, kernel will also add a device-route.
We don't want that route because it has the wrong metric. Instead,
we add our own route (with a different metric) and remove the
kernel-added one.

This could be avoided if kernel would support an IPv4 address flag
IFA_F_NOPREFIXROUTE like it does for IPv6 (see related bug rh#1221311).

One important thing is, that we want don't want to manage the
device-route on assumed devices. Note that this is correct behavior
if "assumed" means "do-not-touch".
If "assumed" means "seamlessly-takeover", then this is wrong.
Imagine we get a new DHCP address. In this case, we would not manage
the device-route on the assumed device. This cannot be fixed without
splitting unmanaged/assumed with related bug bgo 746440.
This is no regression as we would also not manage device-routes
for assumed devices previously.

We also don't want to remove the device-route if the user added
it externally. Note that here we behave wrongly too, because we
don't record externally added kernel routes in update_ip_config().
This still needs fixing.

Let IPv4 device-routes also be managed by NMRouteManager. NMRouteManager
has a list of all routes and can properly add, remove, and restore
the device route as needed.

One problem is, that the device-route does not get added immediately
with the address. It only appears some time later. This is solved
by NMRouteManager watching platform and if a matchin device-route shows up
within a short time after configuring  addresses, remove it.
If the route appears after the short timeout, assume they were added for
other reasons (e.g. by the user) and don't remove them.

https://bugzilla.gnome.org/show_bug.cgi?id=751264
https://bugzilla.redhat.com/show_bug.cgi?id=1211287
(cherry picked from commit 5f54a323d1)
2015-07-01 16:12:14 +02:00
..
tests platform: change NMPlatformGetRouteMode enum to NMPlatformGetRouteFlags flags 2015-07-01 16:10:50 +02:00
wifi platform: rework link type detection for better fallback (bgo #743209) 2015-06-17 15:28:01 +02:00
Makefile.am platform: add minimal Makefile.am for convenience 2013-06-19 13:48:29 +02:00
nm-fake-platform.c route-manager: manage IPv4 device-routes with NMRouteManager 2015-07-01 16:12:14 +02:00
nm-fake-platform.h all: fix up multiple-include-guard defines 2014-08-16 10:17:14 -04:00
nm-linux-platform.c route-manager: manage IPv4 device-routes with NMRouteManager 2015-07-01 16:12:14 +02:00
nm-linux-platform.h platform: add priv pointer to NMLinuxPlatform 2015-06-21 15:23:34 +02:00
nm-platform-utils.c platform: fix setting valid lifetimes when constructing rtnl_addr object 2015-07-01 16:10:49 +02:00
nm-platform-utils.h platform: move address lifetime utils function to nm-platform-utils.c 2015-07-01 16:10:49 +02:00
nm-platform.c route-manager: manage IPv4 device-routes with NMRouteManager 2015-07-01 16:12:14 +02:00
nm-platform.h route-manager: manage IPv4 device-routes with NMRouteManager 2015-07-01 16:12:14 +02:00
nmp-object.c platform: expose routes with "proto kernel" too 2015-07-01 16:10:50 +02:00
nmp-object.h platform/trivial: fix name of enum value OBJECT_TYPE_UNKNOWN 2015-06-24 16:40:11 +02:00