system: 'gateway' may be unset so set to impossible value (PHP warning)

This commit is contained in:
Franco Fichtner 2024-02-13 09:40:32 +01:00
parent 299dbaa017
commit fa22dce74c

View File

@ -549,13 +549,13 @@ function system_host_route($host, $gateway)
function system_interface_route($gw, $routes)
{
$interface = $gw['interface'];
$gateway = $gw['gateway'];
$gateway = $gw['gateway'] ?? 'missing';
$far = isset($gw['fargw']);
$device = $gw['if'];
$family = 'inet';
if (!is_ipaddrv4($gateway)) {
log_msg("ROUTING: not a valid interface gateway address: '{$gateway}'", LOG_ERR);
log_msg("ROUTING: not a valid {$interface} interface gateway address: '{$gateway}'", LOG_ERR);
return;
}