Netfilter-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH nft] main: restore --debug
@ 2020-01-09 17:19 Pablo Neira Ayuso
  0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2020-01-09 17:19 UTC (permalink / raw)
  To: netfilter-devel

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 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main.c b/src/main.c
index 74199f93fa66..6ab1b89f4dd5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
-- 
2.11.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-09 17:19 [PATCH nft] main: restore --debug Pablo Neira Ayuso

Netfilter-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netfilter-devel/0 netfilter-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netfilter-devel netfilter-devel/ https://lore.kernel.org/netfilter-devel \
		netfilter-devel@vger.kernel.org
	public-inbox-index netfilter-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netfilter-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git