diff options
author | Ermal <eri@pfsense.org> | 2013-08-16 14:11:40 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2013-08-16 14:11:59 +0000 |
commit | 8b257982387b1c8c4a8fd339137b970f565d35c6 (patch) | |
tree | db12fdda403a2582e50baa33b31e52d1189973c9 /etc | |
parent | 2391780c83898459ffc8420b8d588d96fc4186a4 (diff) | |
download | pfsense-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.inc | 11 |
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'])) { |