summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xusr/local/www/system_routes.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/usr/local/www/system_routes.php b/usr/local/www/system_routes.php
index 70f251d..5b84b1c 100755
--- a/usr/local/www/system_routes.php
+++ b/usr/local/www/system_routes.php
@@ -81,13 +81,16 @@ if ($_POST) {
if ($_GET['act'] == "del") {
if ($a_routes[$_GET['id']]) {
$changedesc .= gettext("removed route to") . " " . $a_routes[$_GET['id']['route']];
- 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");
- exit;
+ list($ip, $mask) = explode("/", $a_routes[$_GET['id']]['network']);
+ if (is_ipaddr($ip)) {
+ if(is_ipaddrv6($ip))
+ $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");
+ exit;
+ }
}
}
OpenPOWER on IntegriCloud