From: Michael Tremer Date: Sun, 5 May 2013 21:01:21 +0000 (+0200) Subject: iptables: Automatically convert icmp to icmpv6 for IPv6. X-Git-Tag: 007~142^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e65113f1bd9bf4eee3d69fa030e36d94700c7e1;p=network.git iptables: Automatically convert icmp to icmpv6 for IPv6. --- diff --git a/functions.iptables b/functions.iptables index e2e2b2ea..fe519785 100644 --- a/functions.iptables +++ b/functions.iptables @@ -45,6 +45,18 @@ function iptables() { assert isoneof table ${IPTABLES_TABLES} ;; + + # Automatically convert ICMP to ICMPv6 for IPv6 + --protocol|-p) + local proto="${2}" + + if [ "${protocol}" = "ipv6" -a "${proto}" = "icmp" ]; then + proto="icmpv6" + fi + + list_append args "${1} ${proto}" + shift 2 + ;; *) list_append args "${1}"