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



commit bdc58dd6f4ef9004dd3f8937d55a35794b7d7c76
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 559653a..6bcd83d 100644
--- a/src/connection-editor/ip4-routes-dialog.c
+++ b/src/connection-editor/ip4-routes-dialog.c
@@ -172,10 +172,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]