diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-01-16 11:34:33 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-01-16 11:34:33 -0200 |
commit | 70ae8b9cf85d3a6badb32ea60eda3fac38879a42 (patch) | |
tree | 7fa61a3a3ffb4bc974c75a3d8b3b31628d4e8697 /etc/inc | |
parent | 76a7d8e4439e298bad0cafd2d4cf02173366423d (diff) | |
download | pfsense-70ae8b9cf85d3a6badb32ea60eda3fac38879a42.zip pfsense-70ae8b9cf85d3a6badb32ea60eda3fac38879a42.tar.gz |
Revert "When a interface type is changed, old configuration remains. When moving from static ip to ppp, it kepts the static ip configured on interface, when moving from ppp to static ip, it doesn't kill mpd. Implement interface_clean() to make sure only current configuration is in place"
This reverts commit 9111e5fd88f284bd6f66a24a270af9d9fea1b6c7.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/interfaces.inc | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index 83d6020..d1bc279 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1061,60 +1061,6 @@ function interface_vip_bring_down($vip) { } } -function interface_cleanup($interface = "wan") { - global $config, $g; - - if (!isset($config['interfaces'][$interface])) - return; - - $ifcfg = $config['interfaces'][$interface]; - - $ppp_types = array("ppp", "pppoe", "pptp", "l2tp"); - - $realifs = array(get_real_interface($interface)); - - if (in_array($ifcfg['ipaddr'], $ppp_types)) { - if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) { - foreach ($config['ppps']['ppp'] as $pppid => $ppp) { - if (get_real_interface($interface) == $ppp['if']) { - $realifs = array(); - $ports = explode(',',$ppp['ports']); - foreach($ports as $port) { - $realifs[] = get_real_interface($port); - } - } - } - } - } - - foreach ($ppp_types as $type) { - if (($ifcfg['ipaddr'] != $type) && file_exists("{$g['varrun_path']}/{$type}_{$interface}.pid")) { - killbypid("{$g['varrun_path']}/{$type}_{$interface}.pid"); - sleep(2); - } - } - - if (!in_array($ifcfg['ipaddr'], $ppp_types)) - unlink_if_exists("{$g['varetc_path']}/mpd_{$interface}.conf"); - - if ($ifcfg['ipaddr'] != "dhcp") { - foreach($realifs as $realif) { - $pid = find_dhclient_process($realif); - if($pid) - mwexec("/bin/kill {$pid}"); - sleep(1); - } - unlink_if_exists("{$g['varetc_path']}/dhclient_{$interface}.conf"); - } - - if (!is_ipaddrv4($ifcfg['ipaddr'])) { - foreach($realifs as $realif) { - mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " delete", true); - mwexec("/usr/sbin/arp -d -i {$realif} -a"); - } - } -} - function interface_bring_down($interface = "wan", $destroy = false) { global $config, $g; @@ -1126,8 +1072,6 @@ function interface_bring_down($interface = "wan", $destroy = false) { $realif = get_real_interface($interface); - interface_cleanup($interface); - switch ($ifcfg['ipaddr']) { case "ppp": case "pppoe": |