summaryrefslogtreecommitdiffstats
path: root/iptables/tests/shell/testcases/ipt-restore/0006-ip6t-4_0
blob: a37253a9d78e27894c50d1cbeaa6d6812905a55b (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
#!/bin/bash

# Make sure ip6tables-restore simply ignores
# rules starting with -4

set -e

# show rules, drop uninteresting policy settings
ipt_show() {
	$XT_MULTI ip6tables -S | grep -v '^-P'
}

# issue reproducer for ip6tables-restore

$XT_MULTI ip6tables-restore <<EOF
*filter
-A FORWARD -m comment --comment any -j ACCEPT
-4 -A FORWARD -m comment --comment ipv4 -j ACCEPT
-6 -A FORWARD -m comment --comment ipv6 -j ACCEPT
COMMIT
EOF

EXPECT='-A FORWARD -m comment --comment any -j ACCEPT
-A FORWARD -m comment --comment ipv6 -j ACCEPT'

diff -u -Z <(echo -e "$EXPECT") <(ipt_show)