]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
connections.cgi: Ignore empty interfaces
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 6 Dec 2024 16:44:15 +0000 (16:44 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 18 Dec 2024 07:16:41 +0000 (08:16 +0100)
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 <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
html/cgi-bin/connections.cgi

index af375effe0cd73e82b845c402e481c1d33f53244..705118576dd55ccdf743f43869bb6c9a64ccf492 100644 (file)
@@ -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};