From eb30f236d91a8d61ece789e28e6540b3a3fa2a6a Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Wed, 9 Jul 2025 00:13:56 +0200 Subject: rule: print chain and flowtable devices in quotes Print devices in quotes, for consistency with: - the existing chain listing with single device: type filter hook ingress device "lo" priority filter; policy accept - the ifname datatype used in sets. In general, tokens that are user-defined, not coming in the datatype symbol list, are enclosed in quotes. Fixes: 3fdc7541fba0 ("src: add multidevice support for netdev chain") Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso --- src/rule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rule.c b/src/rule.c index c0f7570e..3e3cc3b0 100644 --- a/src/rule.c +++ b/src/rule.c @@ -1062,7 +1062,7 @@ static void chain_print_declaration(const struct chain *chain, } else if (chain->dev_array_len > 1) { nft_print(octx, " devices = { "); for (i = 0; i < chain->dev_array_len; i++) { - nft_print(octx, "%s", chain->dev_array[i]); + nft_print(octx, "\"%s\"", chain->dev_array[i]); if (i + 1 != chain->dev_array_len) nft_print(octx, ", "); } @@ -2149,7 +2149,7 @@ static void flowtable_print_declaration(const struct flowtable *flowtable, if (flowtable->dev_array_len > 0) { nft_print(octx, "%s%sdevices = { ", opts->tab, opts->tab); for (i = 0; i < flowtable->dev_array_len; i++) { - nft_print(octx, "%s", flowtable->dev_array[i]); + nft_print(octx, "\"%s\"", flowtable->dev_array[i]); if (i + 1 != flowtable->dev_array_len) nft_print(octx, ", "); } -- cgit v1.2.3