mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 08:18:03 +02: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;
|
continue;
|
||||||
if (item->plen != route.plen)
|
if (item->plen != route.plen)
|
||||||
continue;
|
continue;
|
||||||
|
if (item->metric != metric)
|
||||||
|
continue;
|
||||||
|
|
||||||
memcpy (item, &route, sizeof (route));
|
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);
|
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;
|
NMPlatformIP6Route route;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
|
metric = nm_utils_ip6_route_metric_normalize (metric);
|
||||||
|
|
||||||
memset (&route, 0, sizeof (route));
|
memset (&route, 0, sizeof (route));
|
||||||
route.source = NM_IP_CONFIG_SOURCE_KERNEL;
|
route.source = NM_IP_CONFIG_SOURCE_KERNEL;
|
||||||
route.ifindex = ifindex;
|
route.ifindex = ifindex;
|
||||||
|
|
@ -1116,6 +1120,8 @@ ip6_route_add (NMPlatform *platform, int ifindex, NMIPConfigSource source,
|
||||||
continue;
|
continue;
|
||||||
if (item->plen != route.plen)
|
if (item->plen != route.plen)
|
||||||
continue;
|
continue;
|
||||||
|
if (item->metric != metric)
|
||||||
|
continue;
|
||||||
|
|
||||||
memcpy (item, &route, sizeof (route));
|
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);
|
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);
|
NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (platform);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
metric = nm_utils_ip6_route_metric_normalize (metric);
|
||||||
|
|
||||||
for (i = 0; i < priv->ip6_routes->len; i++) {
|
for (i = 0; i < priv->ip6_routes->len; i++) {
|
||||||
NMPlatformIP6Route *route = &g_array_index (priv->ip6_routes, NMPlatformIP6Route, i);
|
NMPlatformIP6Route *route = &g_array_index (priv->ip6_routes, NMPlatformIP6Route, i);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue