[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170821163652.23752-2-phil@nwl.cc>
Date: Mon, 21 Aug 2017 18:36:50 +0200
From: Phil Sutter <phil@....cc>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: netdev@...r.kernel.org
Subject: [iproute PATCH v2 1/3] iproute: Check mark value input
Signed-off-by: Phil Sutter <phil@....cc>
---
Changes since v1:
- Drop newline from end of error message, invarg() already does that.
---
ip/iproute.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index cb695ad4141a7..5936e2a978bc7 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -1493,7 +1493,8 @@ static int iproute_list_flush_or_save(int argc, char **argv, int action)
id = *argv;
} else if (strcmp(*argv, "mark") == 0) {
NEXT_ARG();
- get_unsigned(&mark, *argv, 0);
+ if (get_unsigned(&mark, *argv, 0))
+ invarg("invalid mark value", *argv);
filter.markmask = -1;
} else if (strcmp(*argv, "via") == 0) {
int family;
@@ -1710,7 +1711,8 @@ static int iproute_get(int argc, char **argv)
idev = *argv;
} else if (matches(*argv, "mark") == 0) {
NEXT_ARG();
- get_unsigned(&mark, *argv, 0);
+ if (get_unsigned(&mark, *argv, 0))
+ invarg("invalid mark value", *argv);
} else if (matches(*argv, "oif") == 0 ||
strcmp(*argv, "dev") == 0) {
NEXT_ARG();
--
2.13.1
Powered by blists - more mailing lists