summaryrefslogtreecommitdiff
path: root/callouts/nm-dispatcher-utils.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-11-04 15:48:48 -0500
committerDan Winship <danw@gnome.org>2014-11-07 07:49:41 -0500
commite374923bbe4a9f608644756f749b9bae9aa5f349 (patch)
treed7e0fffead6c3e4d1e3433d2b76dec3431b0816f /callouts/nm-dispatcher-utils.c
parentff608c24cd1ac409092f1a883452225a8be6513a (diff)
downloadNetworkManager-e374923bbe4a9f608644756f749b9bae9aa5f349.tar.gz
all: allow route metrics to be "0"
Change NMIPRoute to use "-1" for "default", so that "0" is a valid metric. Update everything for that.
Diffstat (limited to 'callouts/nm-dispatcher-utils.c')
-rw-r--r--callouts/nm-dispatcher-utils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/callouts/nm-dispatcher-utils.c b/callouts/nm-dispatcher-utils.c
index 8feec72d25..8d7274329c 100644
--- a/callouts/nm-dispatcher-utils.c
+++ b/callouts/nm-dispatcher-utils.c
@@ -185,11 +185,11 @@ construct_ip4_items (GSList *items, GVariant *ip4_config, const char *prefix)
if (!next_hop)
next_hop = "0.0.0.0";
- routetmp = g_strdup_printf ("%sIP4_ROUTE_%d=%s/%d %s %d", prefix, i,
+ routetmp = g_strdup_printf ("%sIP4_ROUTE_%d=%s/%d %s %u", prefix, i,
nm_ip_route_get_dest (route),
nm_ip_route_get_prefix (route),
next_hop,
- nm_ip_route_get_metric (route));
+ (guint32) MAX (0, nm_ip_route_get_metric (route)));
items = g_slist_prepend (items, routetmp);
}
items = g_slist_prepend (items, g_strdup_printf ("%sIP4_NUM_ROUTES=%d", prefix, routes->len));
@@ -299,11 +299,11 @@ construct_ip6_items (GSList *items, GVariant *ip6_config, const char *prefix)
if (!next_hop)
next_hop = "::";
- routetmp = g_strdup_printf ("%sIP6_ROUTE_%d=%s/%d %s %d", prefix, i,
+ routetmp = g_strdup_printf ("%sIP6_ROUTE_%d=%s/%d %s %u", prefix, i,
nm_ip_route_get_dest (route),
nm_ip_route_get_prefix (route),
next_hop,
- nm_ip_route_get_metric (route));
+ (guint32) MAX (0, nm_ip_route_get_metric (route)));
items = g_slist_prepend (items, routetmp);
}
if (routes->len)