Bug #2758 » fix_2758.diff
| etc/inc/interfaces.inc | ||
|---|---|---|
|
if ($g['debug'])
|
||
|
log_error("Calling interface down for interface {$interface}, destroy is " . (($destroy) ? 'true' : 'false'));
|
||
|
if ($ifacecfg === false)
|
||
|
if ($ifacecfg === false) {
|
||
|
$ifcfg = $config['interfaces'][$interface];
|
||
|
else if (!is_array($ifacecfg))
|
||
|
$ppps = $config['ppps']['ppp'];
|
||
|
$realif = get_real_interface($interface);
|
||
|
} elseif (!is_array($ifacecfg)) {
|
||
|
log_error(gettext("Wrong parameters used during interface_bring_down"));
|
||
|
else
|
||
|
$ifcfg = $ifacecfg;
|
||
|
|
||
|
$realif = get_real_interface($interface);
|
||
|
} else {
|
||
|
$ifcfg = $ifacecfg['ifcfg'];
|
||
|
$ppps = $ifacecfg['ppps'];
|
||
|
if (isset($ifacecfg['ifcfg']['realif']))
|
||
|
$realif = $ifacecfg['ifcfg']['realif'];
|
||
|
else
|
||
|
$realif = get_real_interface($interface);
|
||
|
}
|
||
|
switch ($ifcfg['ipaddr']) {
|
||
|
case "ppp":
|
||
|
case "pppoe":
|
||
|
case "pptp":
|
||
|
case "l2tp":
|
||
|
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
|
||
|
foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
|
||
|
if (is_array($ppps) && count($ppps)) {
|
||
|
foreach ($ppps as $pppid => $ppp) {
|
||
|
if ($realif == $ppp['if']) {
|
||
|
if (isset($ppp['ondemand']) && !$destroy){
|
||
|
send_event("interface reconfigure {$interface}");
|
||
| usr/local/www/interfaces.php | ||
|---|---|---|
|
$wancfg = &$config['interfaces'][$if];
|
||
|
$old_wancfg = $wancfg;
|
||
|
$old_wancfg['realif'] = get_real_interface($if);
|
||
|
$old_ppps = $a_ppps;
|
||
|
// Populate page descr if it does not exist.
|
||
|
if ($if == "wan" && !$wancfg['descr'])
|
||
|
$wancfg['descr'] = "WAN";
|
||
| ... | ... | |
|
} else {
|
||
|
$toapplylist = array();
|
||
|
}
|
||
|
$toapplylist[$if] = $wancfg;
|
||
|
$toapplylist[$if]['ifcfg'] = $wancfg;
|
||
|
$toapplylist[$if]['ppps'] = $a_ppps;
|
||
|
/* we need to be able remove IP aliases for IPv6 */
|
||
|
file_put_contents("{$g['tmp_path']}/.interfaces.apply", serialize($toapplylist));
|
||
|
header("Location: interfaces.php?if={$if}");
|
||
| ... | ... | |
|
} else {
|
||
|
$toapplylist = array();
|
||
|
}
|
||
|
$toapplylist[$if] = $old_wancfg;
|
||
|
$toapplylist[$if]['ifcfg'] = $old_wancfg;
|
||
|
$toapplylist[$if]['ppps'] = $old_ppps;
|
||
|
file_put_contents("{$g['tmp_path']}/.interfaces.apply", serialize($toapplylist));
|
||
|
mark_subsystem_dirty('interfaces');
|
||
- « Previous
- 1
- 2
- Next »