summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2011-08-18 09:17:31 +0200
committersmos <seth.mos@dds.nl>2011-08-18 09:17:31 +0200
commit37fb708c097eaf1475735f8e56902ff290cfc188 (patch)
tree1eea0e26877102ca5e9afce3e5cc0f78fdb132af /etc
parentb868d9a0c640965002b0a2d03869455f6212e3cf (diff)
downloadpfsense-37fb708c097eaf1475735f8e56902ff290cfc188.zip
pfsense-37fb708c097eaf1475735f8e56902ff290cfc188.tar.gz
Add debugging to interface down function, add support for the type6 = dhcp6.
This really needs to be sorted out in a better way taking both v4 and v6 into consideration simultaneously.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc25
1 files changed, 24 insertions, 1 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index cb5bef3..a010f75 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -1040,6 +1040,8 @@ function interface_bring_down($interface = "wan", $destroy = false) {
if (!isset($config['interfaces'][$interface]))
return;
+ log_error("Calling interface down for interface {$interface}, destroy is {$destroy}");
+
$ifcfg = $config['interfaces'][$interface];
$realif = get_real_interface($interface);
@@ -1075,11 +1077,31 @@ function interface_bring_down($interface = "wan", $destroy = false) {
$pid = find_dhclient_process($realif);
if($pid)
mwexec("/bin/kill {$pid}");
+ sleep(1);
+ unlink_if_exists("{$g['varetc_path']}/dhclient_{$interface}.conf");
+ if(does_interface_exist("$realif")) {
+ mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " delete", true);
+ if ($destroy == true)
+ pfSense_interface_flags($realif, -IFF_UP);
+ mwexec("/usr/sbin/arp -d -i {$realif} -a");
+ }
+ break;
+ default:
+ if(does_interface_exist("$realif")) {
+ mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " delete", true);
+ if ($destroy == true)
+ pfSense_interface_flags($realif, -IFF_UP);
+ mwexec("/usr/sbin/arp -d -i {$realif} -a");
+ }
+ break;
+ }
+
+ switch ($ifcfg['ipaddrv6']) {
+ case "dhcp6":
$pidv6 = find_dhcp6c_process($realif);
if($pidv6)
mwexec("/bin/kill {$pidv6}");
sleep(1);
- unlink_if_exists("{$g['varetc_path']}/dhclient_{$interface}.conf");
unlink_if_exists("{$g['varetc_path']}/dhcp6c_{$interface}.conf");
if(does_interface_exist("$realif")) {
mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " delete", true);
@@ -1098,6 +1120,7 @@ function interface_bring_down($interface = "wan", $destroy = false) {
break;
}
+
/* remove interface up file if it exists */
unlink_if_exists("{$g['tmp_path']}/{$realif}up");
unlink_if_exists("{$g['vardb_path']}/{$interface}ip");
OpenPOWER on IntegriCloud