From a529acedfb8cb1407b5aee5c3d771c596a6662d5 Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 28 Apr 2010 23:16:42 +0000 Subject: Ticket #507. Do not remove all static routes to readd them back. The change will never delete a rule but define the action to be taken on it, either add or change a present route. Be consinstent on gateways allowed to be selected as destinations for static routes, including dynamic gateways. --- usr/local/www/system_routes.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'usr/local/www/system_routes.php') diff --git a/usr/local/www/system_routes.php b/usr/local/www/system_routes.php index a9160c5..fc24962 100755 --- a/usr/local/www/system_routes.php +++ b/usr/local/www/system_routes.php @@ -47,11 +47,8 @@ require_once("shaper.inc"); if (!is_array($config['staticroutes']['route'])) $config['staticroutes']['route'] = array(); -if (!is_array($config['gateways']['gateway_item'])) - $config['gateways']['gateway_item'] = array(); - $a_routes = &$config['staticroutes']['route']; -$a_gateways = &$config['gateways']['gateway_item']; +$a_gateways = return_gateways_array(true); $changedesc = "Static Routes: "; if ($_POST) { @@ -92,6 +89,7 @@ if ($_POST) { if ($_GET['act'] == "del") { if ($a_routes[$_GET['id']]) { $changedesc .= "removed route to " . $a_routes[$_GET['id']['route']]; + mwexec("/sbin/route delete " . escapeshellarg($a_routes[$_GET['id']]['network'])); unset($a_routes[$_GET['id']]); write_config($changedesc); mark_subsystem_dirty('staticroutes'); @@ -160,17 +158,12 @@ include("head.inc"); -- cgit v1.1