diff options
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/firewall_rules_edit.php | 6 | ||||
-rwxr-xr-x | usr/local/www/guiconfig.inc | 17 |
2 files changed, 18 insertions, 5 deletions
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 3bec648..2cdcdbb 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -900,7 +900,11 @@ include("head.inc"); <?php $sel = is_specialnet($pconfig['src']); ?> <option value="any" <?php if ($pconfig['src'] == "any") { echo "selected"; } ?>><?=gettext("any");?></option> - <option value="single" <?php if (($pconfig['srcmask'] == 32) && !$sel) { echo "selected"; $sel = 1; } ?>><?=gettext("Single host or alias");?></option> + <option value="single" <?php + if (!$sel && + ((is_ipaddrv6($pconfig['src']) && ($pconfig['srcmask'] == 128)) || + (is_ipaddrv4($pconfig['src']) && ($pconfig['srcmask'] == 32))) + ) { echo "selected"; $sel = 1; } ?>> <?=gettext("Single host or alias");?></option> <option value="network" <?php if (!$sel) echo "selected"; ?>><?=gettext("Network");?></option> <?php if(have_ruleint_access("pptp")): ?> <option value="pptp" <?php if ($pconfig['src'] == "pptp") { echo "selected"; } ?>><?=gettext("PPTP clients");?></option> diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index e2829d0..cb16f96 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -658,8 +658,12 @@ function address_to_pconfig($adr, &$padr, &$pmask, &$pnot, &$pbeginport, &$pendp $padr = $adr['network']; else if ($adr['address']) { list($padr, $pmask) = explode("/", $adr['address']); - if (!$pmask) - $pmask = 32; + if (!$pmask) { + if (is_ipaddrv6($padr)) + $pmask = 128; + else + $pmask = 32; + } } if (isset($adr['not'])) @@ -686,8 +690,13 @@ function pconfig_to_address(&$adr, $padr, $pmask, $pnot=false, $pbeginport=0, $p $adr['network'] = $padr; else { $adr['address'] = $padr; - if ($pmask != 32) - $adr['address'] .= "/" . $pmask; + if (is_ipaddrv6($padr)) { + if ($pmask != 128) + $adr['address'] .= "/" . $pmask; + } else { + if ($pmask != 32) + $adr['address'] .= "/" . $pmask; + } } if ($pnot) |