diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2015-01-02 15:42:11 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2015-02-27 16:48:27 +0100 |
commit | 874e4a7595ac11e53e333dcdd0ad988a47391cc9 (patch) | |
tree | 1a5c0f5e29e48c68e1dee25e3901adcba78eb25c /src/devices | |
parent | 47167cab4f4c09861874fcb894afc8770437a292 (diff) | |
download | NetworkManager-874e4a7595ac11e53e333dcdd0ad988a47391cc9.tar.gz |
core: split route management code out from platform
Create a NMRouteManager singleton.
Refactor, no functional changes apart from change of log domain from
LOGD_PLATFORM to LOGD_CORE.
Subsequent commit will keep track of the conflicting routes, avoid overwriting
older ones with newer ones and apply the new ones when the old ones go away.
Diffstat (limited to 'src/devices')
-rw-r--r-- | src/devices/nm-device.c | 3 | ||||
-rw-r--r-- | src/devices/wwan/nm-modem.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 05cc4c5716..a54a141fa2 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -69,6 +69,7 @@ #include "nm-dns-manager.h" #include "nm-core-internal.h" #include "nm-default-route-manager.h" +#include "nm-route-manager.h" #include "nm-device-logging.h" _LOG_DECLARE_SELF (NMDevice); @@ -7415,7 +7416,7 @@ nm_device_cleanup (NMDevice *self, NMDeviceStateReason reason) /* Take out any entries in the routing table and any IP address the device had. */ ifindex = nm_device_get_ip_ifindex (self); if (ifindex > 0) { - nm_platform_route_flush (ifindex); + nm_route_manager_route_flush (nm_route_manager_get (), ifindex); nm_platform_address_flush (ifindex); } diff --git a/src/devices/wwan/nm-modem.c b/src/devices/wwan/nm-modem.c index 3729c6202a..9f7f60951a 100644 --- a/src/devices/wwan/nm-modem.c +++ b/src/devices/wwan/nm-modem.c @@ -32,6 +32,7 @@ #include "nm-device-private.h" #include "nm-dbus-glib-types.h" #include "nm-modem-enum-types.h" +#include "nm-route-manager.h" G_DEFINE_TYPE (NMModem, nm_modem, G_TYPE_OBJECT) @@ -922,7 +923,7 @@ deactivate_cleanup (NMModem *self, NMDevice *device) priv->ip6_method == NM_MODEM_IP_METHOD_AUTO) { ifindex = nm_device_get_ip_ifindex (device); if (ifindex > 0) { - nm_platform_route_flush (ifindex); + nm_route_manager_route_flush (nm_route_manager_get (), ifindex); nm_platform_address_flush (ifindex); nm_platform_link_set_down (ifindex); } |