From fa22dce74cf89e21e091bc5b0cfa3487404012a9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 13 Feb 2024 09:40:32 +0100 Subject: [PATCH] system: 'gateway' may be unset so set to impossible value (PHP warning) --- src/etc/inc/system.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index e5046bda8..8428fb72b 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -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; }