diff options
| author | Michael Biebl <biebl@debian.org> | 2015-05-05 17:49:11 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2015-05-05 17:49:11 +0200 |
| commit | e847e3cc3e4eded45a358bf838e1edcf4c12fcb5 (patch) | |
| tree | 9db16e390931b9b800a174c7117b9297b351283f /src/platform/nm-fake-platform.c | |
| parent | 1cd35b49de89f65c386ae2ff98a8e08342c080b0 (diff) | |
| parent | f408e27bccfacf347605a8d98649975a68f38a17 (diff) | |
Merge tag 'upstream/1.0.2'
Upstream version 1.0.2
Diffstat (limited to 'src/platform/nm-fake-platform.c')
| -rw-r--r-- | src/platform/nm-fake-platform.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/platform/nm-fake-platform.c b/src/platform/nm-fake-platform.c index a5eb7d4e..7b0d2d64 100644 --- a/src/platform/nm-fake-platform.c +++ b/src/platform/nm-fake-platform.c @@ -456,6 +456,15 @@ link_get_physical_port_id (NMPlatform *platform, int ifindex) return NULL; } +static guint +link_get_dev_id (NMPlatform *platform, int ifindex) +{ + /* We call link_get just to cause an error to be set if @ifindex is bad. */ + link_get (platform, ifindex); + + return 0; +} + static gboolean link_get_wake_on_lan (NMPlatform *platform, int ifindex) { @@ -1076,6 +1085,8 @@ ip4_route_add (NMPlatform *platform, int ifindex, NMIPConfigSource source, continue; if (item->plen != route.plen) continue; + if (item->metric != metric) + continue; memcpy (item, &route, sizeof (route)); g_signal_emit_by_name (platform, NM_PLATFORM_SIGNAL_IP4_ROUTE_CHANGED, ifindex, &route, NM_PLATFORM_SIGNAL_CHANGED, NM_PLATFORM_REASON_INTERNAL); @@ -1097,6 +1108,8 @@ ip6_route_add (NMPlatform *platform, int ifindex, NMIPConfigSource source, NMPlatformIP6Route route; guint i; + metric = nm_utils_ip6_route_metric_normalize (metric); + memset (&route, 0, sizeof (route)); route.source = NM_IP_CONFIG_SOURCE_KERNEL; route.ifindex = ifindex; @@ -1116,6 +1129,8 @@ ip6_route_add (NMPlatform *platform, int ifindex, NMIPConfigSource source, continue; if (item->plen != route.plen) continue; + if (item->metric != metric) + continue; memcpy (item, &route, sizeof (route)); g_signal_emit_by_name (platform, NM_PLATFORM_SIGNAL_IP6_ROUTE_CHANGED, ifindex, &route, NM_PLATFORM_SIGNAL_CHANGED, NM_PLATFORM_REASON_INTERNAL); @@ -1153,6 +1168,8 @@ ip6_route_get (NMPlatform *platform, int ifindex, struct in6_addr network, int p NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform); int i; + metric = nm_utils_ip6_route_metric_normalize (metric); + for (i = 0; i < priv->ip6_routes->len; i++) { NMPlatformIP6Route *route = &g_array_index (priv->ip6_routes, NMPlatformIP6Route, i); @@ -1301,6 +1318,7 @@ nm_fake_platform_class_init (NMFakePlatformClass *klass) platform_class->link_set_mtu = link_set_mtu; platform_class->link_get_physical_port_id = link_get_physical_port_id; + platform_class->link_get_dev_id = link_get_dev_id; platform_class->link_get_wake_on_lan = link_get_wake_on_lan; platform_class->link_supports_carrier_detect = link_supports_carrier_detect; |