From 71f4a2b70c7283fbc8b4aeb40527c76bfbbd7feb Mon Sep 17 00:00:00 2001 From: smos Date: Wed, 23 May 2012 10:53:49 +0200 Subject: [PATCH] Unbreak adding IPv6 static routes --- usr/local/www/system_routes_edit.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php index ac7e9f198d..dfef30ac6c 100755 --- a/usr/local/www/system_routes_edit.php +++ b/usr/local/www/system_routes_edit.php @@ -113,7 +113,7 @@ if ($_POST) { $osn = Net_IPv6::compress(gen_subnetv6($_POST['network'], $_POST['network_subnet'])) . "/" . $_POST['network_subnet']; $new_targets[] = $osn; } - if (is_ipaddr($_POST['network'])) { + if (is_ipaddrv4($_POST['network'])) { if($_POST['network_subnet'] > 32) $input_errors[] = gettext("A IPv4 subnet can not be over 32 bits."); else { @@ -125,16 +125,20 @@ if ($_POST) { foreach (filter_expand_alias_array($_POST['network']) as $tgt) { if (is_ipaddr($tgt)) $tgt .= "/32"; + if (is_ipaddr($tgt)) + $tgt .= "/128"; if (!is_subnet($tgt)) continue; + if (!is_subnet_v6($tgt)) + continue; $new_targets[] = $tgt; } } if (!isset($id)) $id = count($a_routes); $oroute = $a_routes[$id]; + $old_targets = array(); if (!empty($oroute)) { - $old_targets = array(); if (is_alias($oroute['network'])) { foreach (filter_expand_alias_array($oroute['network']) as $tgt) { if (is_ipaddr($tgt))