diff options
author | Seth Mos <seth.mos@dds.nl> | 2011-10-11 21:55:09 +0200 |
---|---|---|
committer | Seth Mos <seth.mos@dds.nl> | 2011-10-11 21:56:43 +0200 |
commit | ad700f39a25ed94e03e0d1509a19b011db9f71ea (patch) | |
tree | e1a8818b6b88777de2d8dc0d798d13e4096702ad /usr/local/www | |
parent | df39dd8ab4e41c3b668ce8dd9c8b86d7dcceb743 (diff) | |
download | pfsense-ad700f39a25ed94e03e0d1509a19b011db9f71ea.zip pfsense-ad700f39a25ed94e03e0d1509a19b011db9f71ea.tar.gz |
Fix static routes editing and removal for both IPv4 and IPv6. Changing a route should clean up too.
Fix ticket #1892
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/system_routes.php | 4 | ||||
-rwxr-xr-x | usr/local/www/system_routes_edit.php | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/usr/local/www/system_routes.php b/usr/local/www/system_routes.php index 959c940..64484a7 100755 --- a/usr/local/www/system_routes.php +++ b/usr/local/www/system_routes.php @@ -81,7 +81,9 @@ if ($_POST) { if ($_GET['act'] == "del") { if ($a_routes[$_GET['id']]) { $changedesc .= gettext("removed route to") . " " . $a_routes[$_GET['id']['route']]; - mwexec("/sbin/route delete " . escapeshellarg($a_routes[$_GET['id']]['network'])); + if(is_ipaddrv6($a_routes[$_GET['id']]['network'])) + $family = "-inet6"; + mwexec("/sbin/route delete {$family} " . escapeshellarg($a_routes[$_GET['id']]['network'])); unset($a_routes[$_GET['id']]); write_config($changedesc); header("Location: system_routes.php"); diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php index 1e23707..cf38206 100755 --- a/usr/local/www/system_routes_edit.php +++ b/usr/local/www/system_routes_edit.php @@ -93,12 +93,12 @@ if ($_POST) { do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); if (($_POST['network'] && !is_ipaddr($_POST['network']))) { - $input_errors[] = gettext("A valid destination network must be specified."); + $input_errors[] = gettext("A valid IPv4 or IPv6 destination network must be specified."); } if (($_POST['network_subnet'] && !is_numeric($_POST['network_subnet']))) { $input_errors[] = gettext("A valid destination network bit count must be specified."); } - if ($_POST['gateway']) { + if (($_POST['gateway']) && is_ipaddr($_POST['network'])) { if (!isset($a_gateways[$_POST['gateway']])) $input_errors[] = gettext("A valid gateway must be specified."); if(!validate_address_family($_POST['network'], lookup_gateway_ip_by_name($_POST['gateway']))) @@ -144,8 +144,11 @@ if ($_POST) { if (!empty($oroute)) { $osn = explode('/', $oroute['network']); $sn = explode('/', $route['network']); - if ($oroute['network'] <> $route['network']) - $toapplylist[] = "/sbin/route delete {$oroute['network']}"; + if ($oroute['network'] <> $route['network']) { + if(is_ipaddrv6($oroute['network'])) + $family = "-inet6"; + $toapplylist[] = "/sbin/route delete {$family} {$oroute['network']}"; + } } file_put_contents("{$g['tmp_path']}/.system_routes.apply", serialize($toapplylist)); staticroutes_sort(); |