]> git.ipfire.org Git - thirdparty/ipset.git/blame - tests/check_sendip_packets
xlate: Fix for fd leak in error path
[thirdparty/ipset.git] / tests / check_sendip_packets
CommitLineData
fd9361fe
JK
1#!/bin/sh
2
3# -4|-6 dirs pkt-count
4
5set -e
6
7if [ "$1" = "-4" ]; then
8 cmd=iptables
9 proto=ipv4
10 src=10.255.255.64
11 dst=127.0.0.1
12else
13 cmd=ip6tables
14 proto=ipv6
15 src=1002:1002:1002:1002::32
16 dst=::1
17fi
18
19$cmd -A INPUT -m set --match-set test $2 -j DROP
20for x in `seq 1 $3`; do
21 sendip -p $proto -id $dst -is $src -p tcp -td 80 -ts 1025 $dst
22done
23$cmd -D INPUT -m set --match-set test $2 -j DROP
24