From: Michael Tremer Date: Fri, 6 Dec 2024 16:44:15 +0000 (+0000) Subject: connections.cgi: Ignore empty interfaces X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=16cf9f1230da4f0056a65a85a352a5e6c97a67ee;p=people%2Fms%2Fipfire-2.x.git connections.cgi: Ignore empty interfaces Parsing any custom routes for any custom interfaces was broken so that arbitrary routes were imported when not all interfaces were in use. Signed-off-by: Michael Tremer Signed-off-by: Arne Fitzenreiter --- diff --git a/html/cgi-bin/connections.cgi b/html/cgi-bin/connections.cgi index af375effe..705118576 100644 --- a/html/cgi-bin/connections.cgi +++ b/html/cgi-bin/connections.cgi @@ -89,6 +89,9 @@ my @routes = &General::system_output("ip", "route", "show"); # Find all routes foreach my $intf (keys %interfaces) { + # Skip empty interfaces + next if ($intf eq ""); + foreach my $route (grep(/dev ${intf}/, @routes)) { if ($route =~ m/^(\d+\.\d+\.\d+\.\d+\/\d+)/) { $networks{$1} = $interfaces{$intf};