From 788c986343bc24bd0272e8aa409121ffe51f1ef3 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 15 Aug 2016 13:14:18 +0200 Subject: src: quote user-defined strings when used from rule selectors The following selectors display strings using quotes: * meta iifname * meta oifname * meta ibriport * meta obriport However, the following do not: * meta oif * meta iif * meta skuid * meta skgid * meta iifgroup * meta oifgroup * meta rtclassid * ct label Given they refer to user-defined values, neither keywords nor internal built-in known values, let's quote the output of this. This patch modifies symbolic_constant_print() so we can signal this to indicate if the string needs to be quoted. Signed-off-by: Pablo Neira Ayuso --- tests/py/ip/dup.t.payload | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/py/ip/dup.t.payload') diff --git a/tests/py/ip/dup.t.payload b/tests/py/ip/dup.t.payload index 1799b3d2..94d55c6f 100644 --- a/tests/py/ip/dup.t.payload +++ b/tests/py/ip/dup.t.payload @@ -3,13 +3,13 @@ ip test-ip4 test [ immediate reg 1 0x0102a8c0 ] [ dup sreg_addr 1 ] -# dup to 192.168.2.1 device eth0 +# dup to 192.168.2.1 device "eth0" ip test-ip4 test [ immediate reg 1 0x0102a8c0 ] [ immediate reg 2 0x00000002 ] [ dup sreg_addr 1 sreg_dev 2 ] -# dup to ip saddr map { 192.168.2.120 : 192.168.2.1 } device eth0 +# dup to ip saddr map { 192.168.2.120 : 192.168.2.1 } device "eth0" __map%d test-ip4 b __map%d test-ip4 0 element 7802a8c0 : 0102a8c0 0 [end] -- cgit v1.2.3