]> git.ipfire.org Git - people/ms/network.git/commitdiff
iptables: Automatically convert icmp to icmpv6 for IPv6.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 5 May 2013 21:01:21 +0000 (23:01 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 5 May 2013 21:01:21 +0000 (23:01 +0200)
functions.iptables

index e2e2b2ea0245343cfcccf591d52fe020dcf685bd..fe5197850ab46b755e708cac7ca65d05bcf9b2eb 100644 (file)
@@ -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}"