]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: Add test for IPv4 Mapped IPv6 address.
authorVarsha Rao <rvarsha016@gmail.com>
Sun, 19 Nov 2017 12:34:32 +0000 (18:04 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 20 Nov 2017 13:31:03 +0000 (14:31 +0100)
This patch adds test case for IPv4 Mapped IPv6 address.

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
tests/shell/testcases/sets/0027ipv6_maps_ipv4_0 [new file with mode: 0644]

diff --git a/tests/shell/testcases/sets/0027ipv6_maps_ipv4_0 b/tests/shell/testcases/sets/0027ipv6_maps_ipv4_0
new file mode 100644 (file)
index 0000000..7ac271a
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+# Tests IPv4 Mapped IPv6 addresses.
+
+set -e
+
+tmpfile=$(mktemp)
+if [ ! -w $tmpfile ] ; then
+       echo "Failed to create tmp file" >&2
+       exit 0
+fi
+
+trap "rm -rf $tmpfile" EXIT # cleanup if aborted
+
+echo "
+table inet t {
+       set s {
+               type ipv6_addr
+               flags interval
+               elements = { ::ffff:0.0.0.0/96 }
+       }
+}
+" > $tmpfile
+
+$NFT -f $tmpfile