From 1901bd26f779af57dd3317b236bfc6da0db02a45 Mon Sep 17 00:00:00 2001 From: Jonatan Schlag Date: Tue, 30 May 2017 10:33:22 +0200 Subject: [PATCH] route: cli parsing failed when a = was forgotten A command like network route add 192.168.101.0/24 --gateway 192.168.101.254 results in network to be set to 192.168.101.254 which is wrong. Signed-off-by: Jonatan Schlag --- src/functions/functions.route | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/functions/functions.route b/src/functions/functions.route index 4c4f7f63..640c8713 100644 --- a/src/functions/functions.route +++ b/src/functions/functions.route @@ -50,7 +50,12 @@ route_add() { mtu=$(cli_get_val ${1}) ;; *) - network=${1} + if isset network; then + error "Bad number of arguments. Network passed twice or more" + return ${EXIT_ERROR} + else + network=${1} + fi ;; esac shift -- 2.47.3