interfaces: same here

This commit is contained in:
Franco Fichtner 2024-02-13 09:55:26 +01:00
parent fa22dce74c
commit b9f2bb5000

View File

@ -501,14 +501,14 @@ function _interfaces_gre_configure($gre)
$family = 'inet6';
}
$remote_addr = $gre['remote-addr'] . (strpos($local_addr, '%') === false ? '' : '%' . explode('%', $local_addr)[1]);
/* ensured device is there, but do not configure unless system is ready */
if (empty($local_addr)) {
log_msg("Device {$gre['greif']} missing required local address, skipping now.");
return null;
}
$remote_addr = $gre['remote-addr'] . (strpos($local_addr, '%') === false ? '' : '%' . explode('%', $local_addr)[1]);
mwexecf('/sbin/ifconfig %s %s tunnel %s %s', [$gre['greif'], $family, $local_addr, $remote_addr]);
if (is_ipaddrv6($gre['tunnel-local-addr']) || is_ipaddrv6($gre['tunnel-remote-addr'])) {