From 35eb76fa91915877924bdefdb35b39c0404d7969 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 29 Aug 2013 14:38:31 -0300 Subject: Use ipprotocol to check gateway protocol, this fix a issue that allow to set more than one default gateway when it's dynamic --- usr/local/www/system_gateways_edit.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'usr') diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php index 01cd7d0..417184c 100755 --- a/usr/local/www/system_gateways_edit.php +++ b/usr/local/www/system_gateways_edit.php @@ -391,12 +391,7 @@ if ($_POST) { $i = 0; /* remove the default gateway bits for all gateways with the same address family */ foreach($a_gateway_item as $gw) { - if(is_ipaddrv4($gateway['gateway']) && is_ipaddrv4($gw['gateway'])) { - unset($config['gateways']['gateway_item'][$i]['defaultgw']); - if ($gw['interface'] != $_POST['interface'] && $gw['defaultgw']) - $reloadif = $gw['interface']; - } - if(is_ipaddrv6($gateway['gateway']) && is_ipaddrv6($gw['gateway'])) { + if ($gateway['ipprotocol'] == $gw['ipprotocol']) { unset($config['gateways']['gateway_item'][$i]['defaultgw']); if ($gw['interface'] != $_POST['interface'] && $gw['defaultgw']) $reloadif = $gw['interface']; -- cgit v1.1