[network-manager-applet/NMA_0_8] editor: don't allow inserting 0.0.0.0 as destination and netmask for IPv4 routes



commit b743164ef7397fb7469bcaea5b03a8ec2a41b194
Author: JiÅ?í KlimeÅ¡ <jklimes redhat com>
Date:   Tue May 17 14:16:39 2011 +0200

    editor: don't allow inserting 0.0.0.0 as destination and netmask for IPv4 routes
    
    0.0.0.0 would mean default gateway. However, it's not supported in routes now
    anyway. At present, we only support one default gateway and that's taken from
    gateway field of address structure.
    Moreover, inserting 0.0.0.0 renders the connection invalid (verify() in
    libnm-util).

 src/connection-editor/ip4-routes-dialog.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/connection-editor/ip4-routes-dialog.c b/src/connection-editor/ip4-routes-dialog.c
index 7b36897..16e5c1b 100644
--- a/src/connection-editor/ip4-routes-dialog.c
+++ b/src/connection-editor/ip4-routes-dialog.c
@@ -170,10 +170,16 @@ validate (GtkWidget *dialog)
 		/* Address */
 		if (!get_one_addr (model, &tree_iter, COL_ADDRESS, TRUE, &addr))
 			goto done;
+		/* Don't allow inserting 0.0.0.0 for now - that's not supported in libnm-util */
+		if (addr == 0)
+			goto done;
 
 		/* Prefix */
 		if (!get_one_prefix (model, &tree_iter, COL_PREFIX, TRUE, &prefix))
 			goto done;
+		/* Don't allow zero prefix for now - that's not supported in libnm-util */
+		if (prefix == 0)
+			goto done;
 
 		/* Next hop (optional) */
 		if (!get_one_addr (model, &tree_iter, COL_NEXT_HOP, FALSE, &next_hop))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]