]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
main: restore --debug
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 9 Jan 2020 17:16:18 +0000 (18:16 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 9 Jan 2020 17:16:18 +0000 (18:16 +0100)
Broken since options are mandatory before commands.

Fixes: fb9cea50e8b3 ("main: enforce options before commands")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/main.c

index 74199f93fa668a871edb73a2c7de17cf0459ffa6..6ab1b89f4dd57747096d66c3ed70a2064b23312d 100644 (file)
@@ -46,7 +46,7 @@ enum opt_vals {
        OPT_TERSE               = 't',
        OPT_INVALID             = '?',
 };
-#define OPTSTRING      "+hvcf:iI:jvnsNaeSupypTt"
+#define OPTSTRING      "+hvd:cf:iI:jvnsNaeSupypTt"
 
 static const struct option options[] = {
        {
@@ -228,8 +228,10 @@ static bool nft_options_check(int argc, char * const argv[])
                        if (nonoption) {
                                nft_options_error(argc, argv, pos);
                                return false;
-                       } else if (argv[i][1] == 'I' ||
+                       } else if (argv[i][1] == 'd' ||
+                                  argv[i][1] == 'I' ||
                                   argv[i][1] == 'f' ||
+                                  !strcmp(argv[i], "--debug") ||
                                   !strcmp(argv[i], "--includepath") ||
                                   !strcmp(argv[i], "--file")) {
                                skip = true;