summaryrefslogtreecommitdiff
path: root/src/swanctl/command.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@corsac.net>2017-11-21 10:22:31 +0100
committerYves-Alexis Perez <corsac@corsac.net>2017-11-21 10:22:31 +0100
commite1d78dc2faaa06e7c3f71ef674a71e4de2f0758e (patch)
treeae0c8b5f4cd8289d0797882ea18969f33ea59a1e /src/swanctl/command.c
parent11d6b62db969bdd808d0f56706cb18f113927a31 (diff)
downloadvyos-strongswan-e1d78dc2faaa06e7c3f71ef674a71e4de2f0758e.tar.gz
vyos-strongswan-e1d78dc2faaa06e7c3f71ef674a71e4de2f0758e.zip
New upstream version 5.6.1
Diffstat (limited to 'src/swanctl/command.c')
-rw-r--r--src/swanctl/command.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/swanctl/command.c b/src/swanctl/command.c
index 7f65d2b0e..225dff617 100644
--- a/src/swanctl/command.c
+++ b/src/swanctl/command.c
@@ -147,6 +147,15 @@ void command_register(command_t command)
"MAX_COMMANDS\n");
return;
}
+ for (i = 0; i < MAX_COMMANDS && cmds[i].cmd; i++)
+ {
+ if (cmds[i].op == command.op)
+ {
+ fprintf(stderr, "unable to register command --%s, short option "
+ "conflicts with --%s\n", command.cmd, cmds[i].cmd);
+ return;
+ }
+ }
cmds[registered] = command;
/* append default options, but not to --help */