From fcc96054a0935a2eb4aa380ccf0fc8c44987715f Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 11 Dec 2014 19:47:05 -0200 Subject: Split ICMP and ICMPv6 types on Firewall Rules - Remove redundant declaration of $icmptypes and move it to a common place (filter.inc) - Add missing ICMP types for v4 - Add ICMPv6 types - Adjust javascripts to show correct options depending of IP Protocol - Hide ICMP type selection when protocol is IPv4+v6 It fixes #3389 --- usr/local/www/firewall_rules_edit.php | 52 ++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 25 deletions(-) (limited to 'usr/local/www/firewall_rules_edit.php') diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 1b81349..ae12d96 100644 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -691,9 +691,14 @@ if ($_POST) { else unset($filterent['protocol']); - if ($_POST['proto'] == "icmp" && $_POST['icmptype']) - $filterent['icmptype'] = $_POST['icmptype']; - else + if ($_POST['proto'] == "icmp") { + if ($filterent['ipprotocol'] == 'inet6' && $_POST['icmp6type']) + $filterent['icmptype'] = $_POST['icmp6type']; + else if ($filterent['ipprotocol'] != 'inet6' && $_POST['icmptype']) + $filterent['icmptype'] = $_POST['icmptype']; + else + unset($filterent['icmptype']); + } else unset($filterent['icmptype']); pconfig_to_address($filterent['source'], $_POST['src'], @@ -966,7 +971,7 @@ include("head.inc"); - 'IPv4','inet6' => 'IPv6', 'inet46' => 'IPv4+IPv6' ); foreach ($ipproto as $proto => $name): ?>