diff options
author | smos <seth.mos@dds.nl> | 2012-05-21 19:01:05 +0200 |
---|---|---|
committer | smos <seth.mos@dds.nl> | 2012-05-21 19:01:05 +0200 |
commit | ee8c34f4874f2ec49832bf4d8c7894801a168e21 (patch) | |
tree | c2422b72ad553e7521ab5b96685c55f9e5cba8a5 /usr/local/www/firewall_rules_edit.php | |
parent | 44b054ce5c40854f4cf2e4c40aab361f5ce806ce (diff) | |
download | pfsense-ee8c34f4874f2ec49832bf4d8c7894801a168e21.zip pfsense-ee8c34f4874f2ec49832bf4d8c7894801a168e21.tar.gz |
Properly test for the address family now that the array says what it's supposed to be.
Diffstat (limited to 'usr/local/www/firewall_rules_edit.php')
-rwxr-xr-x | usr/local/www/firewall_rules_edit.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 8b24f46..57f01bf 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -206,14 +206,17 @@ if ($_POST) { $input_errors[] = gettext("Queue type rules only work with queues."); if (($_POST['ipprotocol'] <> "") && ($_POST['gateway'] <> "")) { + $a_gatewaygroups = return_gateway_groups_array(); foreach($config['gateways']['gateway_group'] as $gw_group) { if($gw_group['name'] == $_POST['gateway']) { - $af = explode("|", $gw_group['item'][0]); - $ip = lookup_gateway_ip_by_name($af[0]); - if(($_POST['ipprotocol'] == "inet6") && (!is_ipaddrv6($ip))) { + $family = $a_gatewaygroups[$_POST['gateway']]['ipprotocol']; + if($_POST['ipprotocol'] == $family) { + continue; + } + if(($_POST['ipprotocol'] == "inet6") && ($_POST['ipprotocol'] != $family)) { $input_errors[] = gettext("You can not assign a IPv4 gateway group on IPv6 Address Family rule"); } - if(($_POST['ipprotocol'] == "inet") && (!is_ipaddrv4($ip))) { + if(($_POST['ipprotocol'] == "inet") && ($_POST['ipprotocol'] != $family)) { $input_errors[] = gettext("You can not assign a IPv6 gateway group on IPv4 Address Family rule"); } } |