Commit fefd9baf authored by Jos Schellevis's avatar Jos Schellevis

Fixed some typos introduced in ab1cadea

parent ab1cadea
...@@ -778,9 +778,10 @@ function fixup_default_gateway($ipprotocol, $gateways_status, $gateways_arr) { ...@@ -778,9 +778,10 @@ function fixup_default_gateway($ipprotocol, $gateways_status, $gateways_arr) {
} else { } else {
$inetfamily = "-inet"; $inetfamily = "-inet";
} }
if ($defaultgw != $gateways_arr[$dfltgwname]['gateway']) if ($defaultgw != $gateways_arr[$dfltgwname]['gateway']) {
mwexec("/sbin/route delete {$inetfamily} default {$gateways_arr[$dfltgwname]['gateway']}"); mwexec("/sbin/route delete {$inetfamily} default {$gateways_arr[$dfltgwname]['gateway']}");
mwexec("/sbin/route add {$inetfamily} default {$gateways_arr[$dfltgwname]['gateway']}"); mwexec("/sbin/route add {$inetfamily} default {$gateways_arr[$dfltgwname]['gateway']}");
}
} }
} }
......
...@@ -3425,10 +3425,10 @@ function interface_6rd_configure($interface = "wan", $wancfg) { ...@@ -3425,10 +3425,10 @@ function interface_6rd_configure($interface = "wan", $wancfg) {
file_put_contents("{$g['tmp_path']}/{$wanif}_defaultgwv6", "{$rd6brgw}\n"); file_put_contents("{$g['tmp_path']}/{$wanif}_defaultgwv6", "{$rd6brgw}\n");
$ip4gateway = get_interface_gateway($interface); $ip4gateway = get_interface_gateway($interface);
if (is_ipaddrv4($ip4gateway)) if (is_ipaddrv4($ip4gateway)) {
mwexec("/sbin/route delete -host " . escapeshellarg($wancfg['gateway-6rd'])); mwexec("/sbin/route delete -host " . escapeshellarg($wancfg['gateway-6rd']));
mwexec("/sbin/route add -host " . escapeshellarg($wancfg['gateway-6rd']) . " {$ip4gateway}"); mwexec("/sbin/route add -host " . escapeshellarg($wancfg['gateway-6rd']) . " {$ip4gateway}");
}
/* configure dependent interfaces */ /* configure dependent interfaces */
if (!$g['booting']) if (!$g['booting'])
link_interface_to_track6($interface, "update"); link_interface_to_track6($interface, "update");
...@@ -3523,10 +3523,11 @@ function interface_6to4_configure($interface = "wan", $wancfg){ ...@@ -3523,10 +3523,11 @@ function interface_6to4_configure($interface = "wan", $wancfg){
file_put_contents("{$g['tmp_path']}/{$wanif}_defaultgwv6", "{$stfbrgw}"); file_put_contents("{$g['tmp_path']}/{$wanif}_defaultgwv6", "{$stfbrgw}");
$ip4gateway = get_interface_gateway($interface); $ip4gateway = get_interface_gateway($interface);
if (is_ipaddrv4($ip4gateway)) if (is_ipaddrv4($ip4gateway)) {
mwexec("/sbin/route delete -host 192.88.99.1"); mwexec("/sbin/route delete -host 192.88.99.1");
mwexec("/sbin/route add -host 192.88.99.1 {$ip4gateway}"); mwexec("/sbin/route add -host 192.88.99.1 {$ip4gateway}");
}
if (!$g['booting']) if (!$g['booting'])
link_interface_to_track6($interface, "update"); link_interface_to_track6($interface, "update");
......
...@@ -550,12 +550,14 @@ function system_staticroutes_configure($interface = "", $update_dns = false) { ...@@ -550,12 +550,14 @@ function system_staticroutes_configure($interface = "", $update_dns = false) {
$cmd = " {$inet} {$blackhole} " . escapeshellarg($ip) . " "; $cmd = " {$inet} {$blackhole} " . escapeshellarg($ip) . " ";
if (is_subnet($ip)) if (is_subnet($ip))
if (is_ipaddr($gatewayip)) if (is_ipaddr($gatewayip)) {
mwexec("/sbin/route delete".$cmd . escapeshellarg($gatewayip)); mwexec("/sbin/route delete".$cmd . escapeshellarg($gatewayip));
mwexec("/sbin/route add".$cmd . escapeshellarg($gatewayip)); mwexec("/sbin/route add".$cmd . escapeshellarg($gatewayip));
else if (!empty($interfacegw)) }
else if (!empty($interfacegw)) {
mwexec("/sbin/route delete".$cmd . "-iface " . escapeshellarg($interfacegw)); mwexec("/sbin/route delete".$cmd . "-iface " . escapeshellarg($interfacegw));
mwexec("/sbin/route add".$cmd . "-iface " . escapeshellarg($interfacegw)); mwexec("/sbin/route add".$cmd . "-iface " . escapeshellarg($interfacegw));
}
} }
} }
unset($gateways_arr); unset($gateways_arr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment