Project

General

Profile

« Previous | Next » 

Revision c289c48a

Added by Ermal LUÇI almost 12 years ago

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

View differences:

etc/inc/interfaces.inc
2799 2799

  
2800 2800
	if (!$g['booting'] && !(substr($realif, 0, 4) == "ovpn")) {
2801 2801
		/* remove all IPv4 and IPv6 addresses */
2802
		while (mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " -alias", true) == 0);
2803
		while (mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 -alias", true) == 0);
2802
		$tmpifaces = pfSense_getall_interface_addresses($realif);
2803
		if (is_array($tmpifaces)) {
2804
			foreach ($tmpifaces as $tmpiface) {
2805
				if (strstr($iface, ":"))
2806
					mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet6 {$iface} delete");
2807
				else
2808
					mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " inet {$iface} delete");
2809
			}
2810
		}
2804 2811

  
2805 2812
		/* only bring down the interface when both v4 and v6 are set to NONE */
2806 2813
		if(empty($wancfg['ipaddr']) && empty($wancfg['ipaddrv6'])) {

Also available in: Unified diff