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/ip6/ip6.t.payload.ip6 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tests/py/ip6/ip6.t.payload.ip6') diff --git a/tests/py/ip6/ip6.t.payload.ip6 b/tests/py/ip6/ip6.t.payload.ip6 index 70d2ea06..422fabdb 100644 --- a/tests/py/ip6/ip6.t.payload.ip6 +++ b/tests/py/ip6/ip6.t.payload.ip6 @@ -379,21 +379,21 @@ ip6 test-ip6 input [ cmp lt reg 1 0x34120000 0x34123412 0x34123412 0x34123412 ] [ cmp gt reg 1 0x34123412 0x34120000 0x34123412 0x34123412 ] -# iif lo ip6 daddr set ::1 +# iif "lo" ip6 daddr set ::1 ip6 test-ip6 input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] [ immediate reg 1 0x00000000 0x00000000 0x00000000 0x01000000 ] [ payload write reg 1 => 16b @ network header + 24 csum_type 0 csum_off 0 ] -# iif lo ip6 hoplimit set 1 +# iif "lo" ip6 hoplimit set 1 ip6 test-ip6 input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] [ immediate reg 1 0x00000001 ] [ payload write reg 1 => 1b @ network header + 7 csum_type 0 csum_off 0 ] -# iif lo ip6 dscp set af42 +# iif "lo" ip6 dscp set af42 ip6 test-ip6 input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] @@ -401,7 +401,7 @@ ip6 test-ip6 input [ bitwise reg 1 = (reg=1 & 0x00003ff0 ) ^ 0x00000009 ] [ payload write reg 1 => 2b @ network header + 0 csum_type 0 csum_off 0 ] -# iif lo ip6 dscp set 63 +# iif "lo" ip6 dscp set 63 ip6 test-ip6 input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] @@ -409,7 +409,7 @@ ip6 test-ip6 input [ bitwise reg 1 = (reg=1 & 0x00003ff0 ) ^ 0x0000c00f ] [ payload write reg 1 => 2b @ network header + 0 csum_type 0 csum_off 0 ] -# iif lo ip6 ecn set ect0 +# iif "lo" ip6 ecn set ect0 ip6 test-ip6 input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] @@ -417,7 +417,7 @@ ip6 test-ip6 input [ bitwise reg 1 = (reg=1 & 0x000000cf ) ^ 0x00000020 ] [ payload write reg 1 => 1b @ network header + 1 csum_type 0 csum_off 0 ] -# iif lo ip6 ecn set ce +# iif "lo" ip6 ecn set ce ip6 test-ip6 input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] @@ -425,7 +425,7 @@ ip6 test-ip6 input [ bitwise reg 1 = (reg=1 & 0x000000cf ) ^ 0x00000030 ] [ payload write reg 1 => 1b @ network header + 1 csum_type 0 csum_off 0 ] -# iif lo ip6 flowlabel set 0 +# iif "lo" ip6 flowlabel set 0 ip6 test-ip6 input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] @@ -433,7 +433,7 @@ ip6 test-ip6 input [ bitwise reg 1 = (reg=1 & 0x000000f0 ) ^ 0x00000000 ] [ payload write reg 1 => 3b @ network header + 1 csum_type 0 csum_off 0 ] -# iif lo ip6 flowlabel set 12345 +# iif "lo" ip6 flowlabel set 12345 ip6 test-ip6 input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] @@ -441,7 +441,7 @@ ip6 test-ip6 input [ bitwise reg 1 = (reg=1 & 0x000000f0 ) ^ 0x00393000 ] [ payload write reg 1 => 3b @ network header + 1 csum_type 0 csum_off 0 ] -# iif lo ip6 flowlabel set 0xfffff +# iif "lo" ip6 flowlabel set 0xfffff ip6 test-ip6 input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] -- cgit v1.2.3