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!");
|
Remove broken 'dynamic6' gateway, we already have ipprotocol to tell us the IP version, leave it more simple using only 'dynamic'. It helps #3484