tui: extend range of route metric to full uint32

That is how kernel allows it and the rest of NetworkManager's API.
This commit is contained in:
Thomas Haller 2017-09-05 19:20:05 +02:00
parent 08a186558c
commit 4a5ab5f6cb
2 changed files with 2 additions and 5 deletions

View file

@ -498,10 +498,7 @@ ip_route_transform_from_metric_string (GBinding *binding,
gint64 metric;
text = g_value_get_string (source_value);
if (*text)
metric = strtoul (text, NULL, 10);
else
metric = -1;
metric = _nm_utils_ascii_str_to_int64 (text, 10, 0, G_MAXUINT32, -1);
/* Fetch the original property value */
g_object_get (g_binding_get_source (binding),

View file

@ -126,7 +126,7 @@ nmt_route_entry_constructed (GObject *object)
priv->dest = nmt_ip_entry_new (priv->ip_entry_width, priv->family, TRUE, FALSE);
priv->next_hop = nmt_ip_entry_new (priv->ip_entry_width, priv->family, FALSE, TRUE);
priv->metric = nmt_newt_entry_numeric_new_full (priv->metric_entry_width, 0, 65535, TRUE);
priv->metric = nmt_newt_entry_numeric_new_full (priv->metric_entry_width, 0, G_MAXUINT32, TRUE);
nmt_newt_grid_add (grid, priv->dest, 0, 0);
warning_label = create_warning_label (priv->dest);