summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/optimizations/merge_stmts_concat
blob: 9679d86223fd1ce918fff2f61a6ae786093a494e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash

set -e

RULESET="table ip x {
	chain y {
		meta iifname eth1 ip saddr 1.1.1.1 ip daddr 2.2.2.3 accept
		meta iifname eth1 ip saddr 1.1.1.2 ip daddr 2.2.2.4 accept
		meta iifname eth1 ip saddr 1.1.1.2 ip daddr 2.2.3.0/24 accept
		meta iifname eth1 ip saddr 1.1.1.2 ip daddr 2.2.4.0-2.2.4.10 accept
		meta iifname eth2 ip saddr 1.1.1.3 ip daddr 2.2.2.5 accept
		ip protocol . th dport { tcp . 22, udp . 67 }
	}
}"

$NFT -o -f - <<< $RULESET

RULESET="table ip x {
	chain c1 {
		udp dport 51820 iifname "foo" accept
		udp dport { 67, 514 } iifname "bar" accept
	}

	chain c2 {
		udp dport { 51820, 100 } iifname "foo" accept
		udp dport { 67, 514 } iifname "bar" accept
	}

	chain c3 {
		udp dport { 51820, 100 } iifname { "foo", "test" } accept
		udp dport { 67, 514 } iifname "bar" accept
	}
}"

$NFT -o -f - <<< $RULESET