diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-08-15 13:14:18 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-08-18 03:14:08 +0200 |
commit | 788c986343bc24bd0272e8aa409121ffe51f1ef3 (patch) | |
tree | 42cf0210e9fce93e0a5a951f0012e891fa750b05 /tests/py/ip/ip.t.payload.inet | |
parent | ddb1f1f8cdca2e0f70254a5adcc0291907503a36 (diff) |
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 <pablo@netfilter.org>
Diffstat (limited to 'tests/py/ip/ip.t.payload.inet')
-rw-r--r-- | tests/py/ip/ip.t.payload.inet | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/py/ip/ip.t.payload.inet b/tests/py/ip/ip.t.payload.inet index 5cdf2a60..baaf7b35 100644 --- a/tests/py/ip/ip.t.payload.inet +++ b/tests/py/ip/ip.t.payload.inet @@ -548,7 +548,7 @@ inet test-inet input [ bitwise reg 1 = (reg=1 & 0x0000000f ) ^ 0x00000000 ] [ cmp eq reg 1 0x0000000f ] -# iif lo ip daddr set 127.0.0.1 +# iif "lo" ip daddr set 127.0.0.1 inet test-inet input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] @@ -557,7 +557,7 @@ inet test-inet input [ immediate reg 1 0x0100007f ] [ payload write reg 1 => 4b @ network header + 16 csum_type 1 csum_off 10 ] -# iif lo ip checksum set 0 +# iif "lo" ip checksum set 0 inet test-inet input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] @@ -566,7 +566,7 @@ inet test-inet input [ immediate reg 1 0x00000000 ] [ payload write reg 1 => 2b @ network header + 10 csum_type 1 csum_off 10 ] -# iif lo ip id set 0 +# iif "lo" ip id set 0 inet test-inet input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] @@ -575,7 +575,7 @@ inet test-inet input [ immediate reg 1 0x00000000 ] [ payload write reg 1 => 2b @ network header + 4 csum_type 1 csum_off 10 ] -# iif lo ip ecn set 1 +# iif "lo" ip ecn set 1 inet test-inet input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] @@ -585,7 +585,7 @@ inet test-inet input [ bitwise reg 1 = (reg=1 & 0x0000fcff ) ^ 0x00000100 ] [ payload write reg 1 => 2b @ network header + 0 csum_type 1 csum_off 10 ] -# iif lo ip ecn set ce +# iif "lo" ip ecn set ce inet test-netdev ingress [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] @@ -595,7 +595,7 @@ inet test-netdev ingress [ bitwise reg 1 = (reg=1 & 0x0000fcff ) ^ 0x00000300 ] [ payload write reg 1 => 2b @ network header + 0 csum_type 1 csum_off 10 ] -# iif lo ip dscp set af23 +# iif "lo" ip dscp set af23 inet test-inet input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] @@ -605,7 +605,7 @@ inet test-inet input [ bitwise reg 1 = (reg=1 & 0x000003ff ) ^ 0x00005800 ] [ payload write reg 1 => 2b @ network header + 0 csum_type 1 csum_off 10 ] -# iif lo ip dscp set cs0 +# iif "lo" ip dscp set cs0 inet test-inet input [ meta load iif => reg 1 ] [ cmp eq reg 1 0x00000001 ] |