Project

General

Profile

« Previous | Next » 

Revision f7496377

Added by Ermal LUÇI almost 12 years ago

Cleanup some code that is not needed anymore

View differences:

etc/inc/gwlb.inc
165 165
		} else if (is_ipaddrv6($gateway['gateway'])) {
166 166
			/* link locals really need a different src ip */
167 167
			if(is_linklocal($gateway['gateway'])) {
168
				$linklocal = explode("%", find_interface_ipv6_ll($gateway['interface'], true));
169
				$gwifip = $linklocal[0];
170
				$ifscope = "%". $linklocal[1];
168
				$gwifip = find_interface_ipv6_ll($gateway['interface'], true);
171 169
			} else {
172 170
				$gwifip = find_interface_ipv6($gateway['interface'], true);
173 171
			}
etc/inc/interfaces.inc
4361 4361
	/* Setup IP cache */
4362 4362
	if (!isset($interface_ipv6_arr_cache[$interface]) or $flush) {
4363 4363
		$ifinfo = pfSense_get_interface_addresses($interface);
4364
		exec("/sbin/ifconfig {$interface} inet6", $output);
4365 4364
		$interface_ipv6_arr_cache[$interface] = $ifinfo['ipaddr6'];
4366 4365
		$interface_snv6_arr_cache[$interface] = $ifinfo['subnetbits6'];
4367 4366
	}
......
4422 4421
	if (does_interface_exist($interface) == false)
4423 4422
		return;
4424 4423

  
4425
	$foundv6 = false;
4426 4424
	if (!isset($interface_snv6_arr_cache[$interface]) or $flush) {
4427
		$ifinfo = array();
4428
		// FIXME: Add IPv6 support to the pfSense module
4429
		unset($output);
4430
		exec("/sbin/ifconfig {$interface} inet6", $output);
4431
		foreach($output as $line) {
4432
			$line = trim($line);
4433
			if(preg_match("/inet6/", $line)) {
4434
				$parts = explode(" ", $line);
4435
				if(!is_linklocal($parts[1])) {
4436
					$ifinfo['ipaddrv6'] = $parts[1];
4437
					if($parts[2] == "-->") {
4438
						$parts[5] = "126";
4439
						$ifinfo['subnetbitsv6'] = $parts[5];
4440
					} else {
4441
						$ifinfo['subnetbitsv6'] = $parts[3];
4442
					}
4443
					$foundv6 = true;
4444
					break;
4445
				}
4446
			}
4447
		}
4448
		if ($foundv6 === true) {
4449
			$interface_ipv6_arr_cache[$interface] = $ifinfo['ipaddrv6'];
4450
			$interface_snv6_arr_cache[$interface] = $ifinfo['subnetbitsv6'];
4451
		} else
4452
			unset($interface_ipv6_arr_cache[$interface], $interface_snv6_arr_cache[$interface]);
4425
		$ifinfo = pfSense_get_interface_addresses($interface);
4426
		$interface_ipv6_arr_cache[$interface] = $ifinfo['ipaddr6'];
4427
		$interface_snv6_arr_cache[$interface] = $ifinfo['subnetbits6'];
4453 4428
	}
4454 4429

  
4455 4430
	return $interface_snv6_arr_cache[$interface];

Also available in: Unified diff