summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-09-05 19:20:05 +0200
committerThomas Haller <thaller@redhat.com>2017-09-05 19:27:19 +0200
commit4a5ab5f6cbeb5e5df8cdfcfdc4b5d1a8aad1101e (patch)
treebf9e87b96e4515c76e71f5a288a2e71adb0fd44f
parent08a186558c5ed3c2d4f685dadda371f6ce72360c (diff)
downloadNetworkManager-4a5ab5f6cbeb5e5df8cdfcfdc4b5d1a8aad1101e.tar.gz
tui: extend range of route metric to full uint32
That is how kernel allows it and the rest of NetworkManager's API.
-rw-r--r--clients/tui/nm-editor-bindings.c5
-rw-r--r--clients/tui/nmt-route-entry.c2
2 files changed, 2 insertions, 5 deletions
diff --git a/clients/tui/nm-editor-bindings.c b/clients/tui/nm-editor-bindings.c
index 7ac7f0c7e2..3c589f40f5 100644
--- a/clients/tui/nm-editor-bindings.c
+++ b/clients/tui/nm-editor-bindings.c
@@ -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),
diff --git a/clients/tui/nmt-route-entry.c b/clients/tui/nmt-route-entry.c
index 1f58fc0000..1b37389f93 100644
--- a/clients/tui/nmt-route-entry.c
+++ b/clients/tui/nmt-route-entry.c
@@ -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);