File: anon_chain_loop

package info (click to toggle)
nftables 1.1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,384 kB
  • sloc: ansic: 50,901; sh: 20,277; yacc: 5,861; python: 1,746; lex: 1,367; makefile: 392
file content (19 lines) | stat: -rwxr-xr-x 360 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

# anon chains with c1 -> c2 recursive jump, expect failure
$NFT -f - <<EOF
table ip t {
 chain c2 { type filter hook input priority 0; }
 chain c1 { }
}

add t c1 ip saddr 127.0.0.1 jump { jump c2; }
add t c2 ip saddr 127.0.0.1 jump { jump c1; }
EOF

if [ $? -eq 0 ] ; then
        echo "E: able to load bad ruleset" >&2
        exit 1
fi

exit 0