charon-cmd: pass arguments to all handlers, even if already handled
authorMartin Willi <martin@revosec.ch>
Tue, 26 Mar 2013 16:38:02 +0000 (17:38 +0100)
committerMartin Willi <martin@revosec.ch>
Mon, 6 May 2013 13:28:27 +0000 (15:28 +0200)
src/charon-cmd/charon-cmd.c

index acfdcba..d0fc4da 100644 (file)
@@ -254,6 +254,8 @@ static void handle_arguments(int argc, char *argv[])
        }
        while (TRUE)
        {
+               bool handled = FALSE;
+
                opt = getopt_long(argc, argv, "", long_opts, NULL);
                switch (opt)
                {
@@ -266,8 +268,9 @@ static void handle_arguments(int argc, char *argv[])
                                printf("%s, strongSwan %s\n", "charon-cmd", VERSION);
                                exit(0);
                        default:
-                               if (conn->handle(conn, opt, optarg) ||
-                                       creds->handle(creds, opt, optarg))
+                               handled |= conn->handle(conn, opt, optarg);
+                               handled |= creds->handle(creds, opt, optarg);
+                               if (handled)
                                {
                                        continue;
                                }