From 1ccfb89eabe24005e3bd794d91d5db8094678a2b Mon Sep 17 00:00:00 2001 From: Alexander Marx Date: Mon, 7 Apr 2014 16:14:20 +0200 Subject: [PATCH] Firewall: fix coloring of internet hosts --- html/cgi-bin/fwhosts.cgi | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index 042fdde0c5..53d93ef5a5 100644 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -66,7 +66,6 @@ my $fwconfigfwd = "${General::swroot}/firewall/config"; my $fwconfiginp = "${General::swroot}/firewall/input"; my $fwconfigout = "${General::swroot}/firewall/outgoing"; my $configovpn = "${General::swroot}/ovpn/settings"; -my $tdcolor=''; my $configipsecrw = "${General::swroot}/vpn/settings"; unless (-e $confignet) { system("touch $confignet"); } @@ -1624,6 +1623,7 @@ sub getcolor my $c=shift; my $sip; my $scidr; + my $tdcolor=''; #Check if MAC if (&General::validmac($c)){ return $c;} @@ -1688,10 +1688,13 @@ sub getcolor #Check if IP is part of a IPsec N2N network foreach my $key (sort keys %ipsecconf){ - my ($a,$b) = split("/",$ipsecconf{$key}[11]); - if (&General::IpInSubnet($sip,$a,$b)){ - $tdcolor="$c"; - return $tdcolor; + if ($ipsecconf{$key}[11]){ + my ($a,$b) = split("/",$ipsecconf{$key}[11]); + $b=&General::iporsubtodec($b); + if (&General::IpInSubnet($sip,$a,$b)){ + $tdcolor="$c"; + return $tdcolor; + } } } return "$c"; -- 2.39.5