mirror of
https://github.com/sheumann/hush.git
synced 2025-01-02 09:31:26 +00:00
ip tunnel: unify parsing args; no obj-code changes
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
This commit is contained in:
parent
ab0e412937
commit
96913f9254
@ -561,11 +561,10 @@ int do_iptunnel(char **argv)
|
|||||||
static const char keywords[] ALIGN1 =
|
static const char keywords[] ALIGN1 =
|
||||||
"add\0""change\0""delete\0""show\0""list\0""lst\0";
|
"add\0""change\0""delete\0""show\0""list\0""lst\0";
|
||||||
enum { ARG_add = 0, ARG_change, ARG_del, ARG_show, ARG_list, ARG_lst };
|
enum { ARG_add = 0, ARG_change, ARG_del, ARG_show, ARG_list, ARG_lst };
|
||||||
int key;
|
|
||||||
|
|
||||||
if (*argv) {
|
if (*argv) {
|
||||||
key = index_in_substrings(keywords, *argv);
|
smalluint key = index_in_substrings(keywords, *argv);
|
||||||
if (key < 0)
|
if (key > 5)
|
||||||
bb_error_msg_and_die(bb_msg_invalid_arg, *argv, applet_name);
|
bb_error_msg_and_die(bb_msg_invalid_arg, *argv, applet_name);
|
||||||
argv++;
|
argv++;
|
||||||
if (key == ARG_add)
|
if (key == ARG_add)
|
||||||
|
Loading…
Reference in New Issue
Block a user