|
|
bacbc8 |
From b4a5b3b3b0a46d9155d0e07e5ab226cf5697cd13 Mon Sep 17 00:00:00 2001
|
|
|
bacbc8 |
From: Florian Westphal <fw@strlen.de>
|
|
|
bacbc8 |
Date: Wed, 9 Jan 2019 23:26:05 +0100
|
|
|
bacbc8 |
Subject: [PATCH] src: fix netdev family device name parsing
|
|
|
bacbc8 |
|
|
|
bacbc8 |
Should use accept/use quotes, else you can't use this with a device name
|
|
|
bacbc8 |
that is shared with a key word, e.g. 'device vm'.
|
|
|
bacbc8 |
|
|
|
bacbc8 |
Signed-off-by: Florian Westphal <fw@strlen.de>
|
|
|
bacbc8 |
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
bacbc8 |
(cherry picked from commit b338244abc7f018d79a95657fff88eadee7e9f6b)
|
|
|
bacbc8 |
|
|
|
bacbc8 |
Conflicts:
|
|
|
bacbc8 |
src/rule.c
|
|
|
bacbc8 |
tests/shell/testcases/chains/dumps/0021prio_0.nft
|
|
|
bacbc8 |
-> Context change due to missing commit c8a0e8c90e2d1
|
|
|
bacbc8 |
("src: Set/print standard chain prios with textual names")
|
|
|
bacbc8 |
|
|
|
bacbc8 |
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
|
|
bacbc8 |
---
|
|
|
bacbc8 |
src/parser_bison.y | 2 +-
|
|
|
bacbc8 |
src/rule.c | 2 +-
|
|
|
bacbc8 |
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
bacbc8 |
|
|
|
bacbc8 |
diff --git a/src/parser_bison.y b/src/parser_bison.y
|
|
|
bacbc8 |
index aabf16316ff8b..f86a754deea8e 100644
|
|
|
bacbc8 |
--- a/src/parser_bison.y
|
|
|
bacbc8 |
+++ b/src/parser_bison.y
|
|
|
bacbc8 |
@@ -1793,7 +1793,7 @@ prio_spec : NUM { $$ = $1; }
|
|
|
bacbc8 |
| DASH NUM { $$ = -$2; }
|
|
|
bacbc8 |
;
|
|
|
bacbc8 |
|
|
|
bacbc8 |
-dev_spec : DEVICE STRING { $$ = $2; }
|
|
|
bacbc8 |
+dev_spec : DEVICE string { $$ = $2; }
|
|
|
bacbc8 |
| /* empty */ { $$ = NULL; }
|
|
|
bacbc8 |
;
|
|
|
bacbc8 |
|
|
|
bacbc8 |
diff --git a/src/rule.c b/src/rule.c
|
|
|
bacbc8 |
index c3a2e7cc464bb..0b494e4326be6 100644
|
|
|
bacbc8 |
--- a/src/rule.c
|
|
|
bacbc8 |
+++ b/src/rule.c
|
|
|
bacbc8 |
@@ -773,7 +773,7 @@ static void chain_print_declaration(const struct chain *chain,
|
|
|
bacbc8 |
nft_print(octx, "\t\ttype %s hook %s", chain->type,
|
|
|
bacbc8 |
hooknum2str(chain->handle.family, chain->hooknum));
|
|
|
bacbc8 |
if (chain->dev != NULL)
|
|
|
bacbc8 |
- nft_print(octx, " device %s", chain->dev);
|
|
|
bacbc8 |
+ nft_print(octx, " device \"%s\"", chain->dev);
|
|
|
bacbc8 |
nft_print(octx, " priority %d; policy %s;\n",
|
|
|
bacbc8 |
chain->priority, chain_policy2str(chain->policy));
|
|
|
bacbc8 |
}
|
|
|
bacbc8 |
--
|
|
|
bacbc8 |
2.21.0
|
|
|
bacbc8 |
|