Debian Codegraph @

tests/shell/testcases/maps/0016map_leak_0

raw
1 #!/bin/bash
2
3 set -e
4
5 RULESET="table ip t {
6 map sourcemap {
7 type ipv4_addr : verdict
8 elements = { 100.123.10.2 : jump c }
9 }
10
11 chain c {
12 }
13 }"
14
15 $NFT -f - <<< "$RULESET"
16 # again, since it is addition, not creation, it is successful
17 $NFT -f - <<< "$RULESET"
18 # flush it to check for refcount leak
19 $NFT flush ruleset
20
21 #
22 # again with stateful objects
23 #
24
25 RULESET="table ip t {
26 counter c {}
27
28 map sourcemap {
29 type ipv4_addr : counter
30 elements = { 100.123.10.2 : \"c\" }
31 }
32 }"
33
34 $NFT -f - <<< "$RULESET"
35 # again, since it is addition, not creation, it is successful
36 $NFT -f - <<< "$RULESET"
37 # flush it to check for refcount leak
38 $NFT flush ruleset