mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
connections.cgi: fix connection list if green interface is not present
if green interface not exist the cgi adds empty addresses to the arrays and display nothing. Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# #
|
# #
|
||||||
# IPFire.org - A linux based firewall #
|
# IPFire.org - A linux based firewall #
|
||||||
# Copyright (C) 2007-2012 IPFire Team <info@ipfire.org> #
|
# Copyright (C) 2007-2021 IPFire Team <info@ipfire.org> #
|
||||||
# #
|
# #
|
||||||
# This program is free software: you can redistribute it and/or modify #
|
# This program is free software: you can redistribute it and/or modify #
|
||||||
# it under the terms of the GNU General Public License as published by #
|
# it under the terms of the GNU General Public License as published by #
|
||||||
@@ -154,19 +154,21 @@ push(@network, $netsettings{'GREEN_ADDRESS'});
|
|||||||
push(@masklen, "255.255.255.255" );
|
push(@masklen, "255.255.255.255" );
|
||||||
push(@colour, ${Header::colourfw} );
|
push(@colour, ${Header::colourfw} );
|
||||||
|
|
||||||
# Add Green Network to Array
|
if ($netsettings{'GREEN_DEV'}) {
|
||||||
push(@network, $netsettings{'GREEN_NETADDRESS'});
|
# Add Green Network to Array
|
||||||
push(@masklen, $netsettings{'GREEN_NETMASK'} );
|
push(@network, $netsettings{'GREEN_NETADDRESS'});
|
||||||
push(@colour, ${Header::colourgreen} );
|
push(@masklen, $netsettings{'GREEN_NETMASK'} );
|
||||||
|
|
||||||
# Add Green Routes to Array
|
|
||||||
my @routes = grep (/$netsettings{'GREEN_DEV'}/, @all_routes);
|
|
||||||
foreach my $route (@routes) {
|
|
||||||
chomp($route);
|
|
||||||
my @temp = split(/[\t ]+/, $route);
|
|
||||||
push(@network, $temp[0]);
|
|
||||||
push(@masklen, $temp[2]);
|
|
||||||
push(@colour, ${Header::colourgreen} );
|
push(@colour, ${Header::colourgreen} );
|
||||||
|
|
||||||
|
# Add Green Routes to Array
|
||||||
|
my @routes = grep (/$netsettings{'GREEN_DEV'}/, @all_routes);
|
||||||
|
foreach my $route (@routes) {
|
||||||
|
chomp($route);
|
||||||
|
my @temp = split(/[\t ]+/, $route);
|
||||||
|
push(@network, $temp[0]);
|
||||||
|
push(@masklen, $temp[2]);
|
||||||
|
push(@colour, ${Header::colourgreen} );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add Blue Firewall Interface
|
# Add Blue Firewall Interface
|
||||||
@@ -181,7 +183,7 @@ if ($netsettings{'BLUE_DEV'}) {
|
|||||||
push(@colour, ${Header::colourblue} );
|
push(@colour, ${Header::colourblue} );
|
||||||
|
|
||||||
# Add Blue Routes to Array
|
# Add Blue Routes to Array
|
||||||
@routes = grep(/$netsettings{'BLUE_DEV'}/, @all_routes);
|
my @routes = grep(/$netsettings{'BLUE_DEV'}/, @all_routes);
|
||||||
foreach my $route (@routes) {
|
foreach my $route (@routes) {
|
||||||
chomp($route);
|
chomp($route);
|
||||||
my @temp = split(/[\t ]+/, $route);
|
my @temp = split(/[\t ]+/, $route);
|
||||||
@@ -202,7 +204,7 @@ if ($netsettings{'ORANGE_DEV'}) {
|
|||||||
push(@masklen, $netsettings{'ORANGE_NETMASK'} );
|
push(@masklen, $netsettings{'ORANGE_NETMASK'} );
|
||||||
push(@colour, ${Header::colourorange} );
|
push(@colour, ${Header::colourorange} );
|
||||||
# Add Orange Routes to Array
|
# Add Orange Routes to Array
|
||||||
@routes = grep(/$netsettings{'ORANGE_DEV'}/, @all_routes);
|
my @routes = grep(/$netsettings{'ORANGE_DEV'}/, @all_routes);
|
||||||
foreach my $route (@routes) {
|
foreach my $route (@routes) {
|
||||||
chomp($route);
|
chomp($route);
|
||||||
my @temp = split(/[\t ]+/, $route);
|
my @temp = split(/[\t ]+/, $route);
|
||||||
|
|||||||
Reference in New Issue
Block a user