Project

General

Profile

« Previous | Next » 

Revision d07bc322

Added by Renato Botelho over 11 years ago

Remove broken 'dynamic6' gateway, we already have ipprotocol to tell us the IP version, leave it more simple using only 'dynamic'. It helps #3484

View differences:

etc/inc/gwlb.inc
431 431
				continue;
432 432

  
433 433
			/* if the gateway is dynamic and we can find the IPv4, Great! */
434
			if (empty($gateway['gateway']) || $gateway['gateway'] == "dynamic" || $gateway['gateway'] == "dynamic6") {
434
			if (empty($gateway['gateway']) || $gateway['gateway'] == "dynamic") {
435 435
				if ($gateway['ipprotocol'] == "inet") {
436 436
					/* we know which interfaces is dynamic, this should be made a function */
437 437
					$gateway['gateway'] = get_interface_gateway($gateway['interface']);
......
441 441
					$gateway['dynamic'] = true;
442 442
				}
443 443

  
444
				/* if the gateway is dynamic6 and we can find the IPv6, Great! */
444
				/* if the gateway is dynamic and we can find the IPv6, Great! */
445 445
				else if ($gateway['ipprotocol'] == "inet6") {
446 446
					/* we know which interfaces is dynamic, this should be made a function, and for v6 too */
447 447
					$gateway['gateway'] = get_interface_gateway_v6($gateway['interface']);
448
					/* no IPv6 address found, set to dynamic6 */
448
					/* no IPv6 address found, set to dynamic */
449 449
					if (!is_ipaddrv6($gateway['gateway']))
450
						$gateway['gateway'] = "dynamic6";
450
						$gateway['gateway'] = "dynamic";
451 451
					$gateway['dynamic'] = true;
452 452
				}
453 453
			} else {
......
628 628

  
629 629
		/* Loopback dummy for dynamic interfaces without a IP */
630 630
		if (!is_ipaddrv6($gateway['gateway']) && $gateway['dynamic'] == true)
631
			$gateway['gateway'] = "dynamic6";
631
			$gateway['gateway'] = "dynamic";
632 632

  
633 633
		/* automatically skip known static and dynamic gateways we have a array entry for */
634 634
		foreach($gateways_arr as $gateway_item) {
......
713 713
			$dfltgwdown = true;
714 714
	}
715 715
	if ($dfltgwdown == true && !empty($upgw)) {
716
		if (preg_match("/dynamic/i", $gateways_arr[$upgw]['gateway']))
716
		if ($gateways_arr[$upgw]['gateway'] == "dynamic")
717 717
			$gateways_arr[$upgw]['gateway'] = get_interface_gateway($gateways_arr[$upgw]['friendlyiface']);
718 718
		if (is_ipaddr($gateways_arr[$upgw]['gateway'])) {
719 719
			log_error("Default gateway down setting {$upgw} as default!");
etc/inc/system.inc
400 400
							@file_put_contents("{$g['tmp_path']}/{$defaultif}_defaultgw", $gateway['gateway']);
401 401
					}
402 402
					$foundgw = true;
403
				} else if ($gateway['ipprotocol'] == "inet6" && (is_ipaddrv6($gateway['gateway']) || $gateway['gateway'] == "dynamic6")) {
404
					if ($gateway['gateway'] == "dynamic6")
403
				} else if ($gateway['ipprotocol'] == "inet6" && (is_ipaddrv6($gateway['gateway']) || $gateway['gateway'] == "dynamic")) {
404
					if ($gateway['gateway'] == "dynamic")
405 405
						$gateway['gateway'] = get_interface_gateway_v6($gateway['interface']);
406 406
					$gatewayipv6 = $gateway['gateway'];
407 407
					$interfacegwv6 = $gateway['interface'];

Also available in: Unified diff