Fix several handling of gif/gre addresses and automatically added routes.

This commit is contained in:
Ermal Lui 2010-02-01 15:13:04 +00:00
parent 1dd1e41fc2
commit c0481e1cb5
2 changed files with 5 additions and 5 deletions

View File

@ -574,7 +574,7 @@ function interface_gre_configure(&$gre) {
else
log_error("Could not bring greif up -- variable not defined.");
mwexec("/sbin/route add {$gre['remote-addr']}/{$gre['tunnel-remote-net']} {$realifip}");
mwexec("/sbin/route add {$gre['remote-addr']}/{$gre['tunnel-remote-net']} -iface {$greif}");
file_put_contents("{$g['tmp_path']}/{$greif}_router", $gre['tunnel-remote-addr']);
return $greif;
@ -628,7 +628,7 @@ function interface_gif_configure(&$gif) {
else
log_error("could not bring gifif up -- variable not defined");
mwexec("/sbin/route add {$gif['remote-addr']}/{$gif['tunnel-remote-net']} {$realifip}");
mwexec("/sbin/route add {$gif['remote-addr']}/{$gif['tunnel-remote-net']} -iface {$gifif}");
file_put_contents("{$g['tmp_path']}/{$gifif}_router", $gif['tunnel-remote-addr']);
return $gifif;
@ -1738,7 +1738,7 @@ function interface_configure($interface = "wan", $reloadall = false) {
if (link_interface_to_gif($interface)) {
foreach ($config['gifs']['gif'] as $gif)
if ($gif['if'] == $interface)
interface_gre_configure($gif);
interface_gif_configure($gif);
}
if (link_interface_to_bridge($interface)) {
foreach ($config['bridges']['bridged'] as $bridge)

View File

@ -360,7 +360,7 @@ function system_routing_configure() {
$gatewayip = $rtent['gateway'];
$interfacegw = $rtent['interface'];
}
if((isset($rtent['interfacegateway'])) && (! is_ipaddr($gatewayip))){
if((isset($rtent['interfacegateway'])) && (! is_ipaddr($gatewayip))) {
mwexec("/sbin/route add " . escapeshellarg($rtent['network']) .
" -iface " . escapeshellarg(convert_friendly_interface_to_real_interface_name($interfacegw)));
} else {
@ -1356,4 +1356,4 @@ function enable_watchdog() {
}
}
?>
?>