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:59 +0000
commit8b257982387b1c8c4a8fd339137b970f565d35c6 (patch)
treedb12fdda403a2582e50baa33b31e52d1189973c9 /etc
parent2391780c83898459ffc8420b8d588d96fc4186a4 (diff)
downloadpfsense-8b257982387b1c8c4a8fd339137b970f565d35c6.zip
pfsense-8b257982387b1c8c4a8fd339137b970f565d35c6.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 fb62c06..546cc6c 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