mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 10:40:08 +01:00
platform/tests: fix errors in fake platform handling route metrics
This commit is contained in:
parent
529591d8de
commit
0f1fca29db
1 changed files with 8 additions and 0 deletions
|
|
@ -1076,6 +1076,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 +1099,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 +1120,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 +1159,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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue