summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-08-16 14:11:40 +0000
committerErmal <eri@pfsense.org>2013-08-16 14:11:40 +0000
commitc289c48a1f2ead64245e146f9c44e7e53400920e (patch)
treef6214e29372e16a71b305b6729c2b237bd87d272 /etc
parenta55dd5371dcd035a10ecc9edf0a0d6aa9f3869b0 (diff)
downloadpfsense-c289c48a1f2ead64245e146f9c44e7e53400920e.zip
pfsense-c289c48a1f2ead64245e146f9c44e7e53400920e.tar.gz
Correctly remove IPv6 addresses from the interface rather than just erroring out. The same trick that works for IPv4 of not specifying address does not work with v6
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/interfaces.inc11
1 files changed, 9 insertions, 2 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 673887d..89ea60a 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -2799,8 +2799,15 @@ function interface_configure($interface = "wan", $reloadall = false, $linkupeven
if (!$g['booting'] && !(substr($realif, 0, 4) == "ovpn")) {
/* remove all IPv4 and IPv6 addresses */
- while (mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " -alias", true) == 0);
- while (mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 -alias", true) == 0);
+ $tmpifaces = pfSense_getall_interface_addresses($realif);
+ if (is_array($tmpifaces)) {
+ foreach ($tmpifaces as $tmpiface) {
+ if (strstr($iface, ":"))
+ mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 {$iface} delete");
+ else
+ mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet {$iface} delete");
+ }
+ }
/* only bring down the interface when both v4 and v6 are set to NONE */
if(empty($wancfg['ipaddr']) && empty($wancfg['ipaddrv6'])) {
OpenPOWER on IntegriCloud