fixed to not show the red background color in listening network ports using IPv6 in the 'port' graph

This commit is contained in:
Jordi Sanfeliu 2015-06-30 17:54:26 +02:00
parent 9ab35fa122
commit 9a56b9608c
2 changed files with 9 additions and 3 deletions

View File

@ -34,6 +34,9 @@
- Fixed a wrong example in the documentation when showing how to define the same
port number using IPv4 and IPv6 in the 'port' graph.
(thanks to Dirk Tanneberger, os AT tanneberger.biz for pointing this out)
- Fixed to not show the red background color in listening network ports using
IPv6 in the 'port' graph.
(thanks to Dirk Tanneberger, os AT tanneberger.biz for pointing this out)
- Small cosmetic changes.

View File

@ -500,12 +500,15 @@ sub port_cgi {
}
my $pnum;
$pl[$n] = trim($pl[$n]);
my $num = ($pl[$n] =~ m/^(\d+).*?/)[0]; # strips any suffix from port number
my $pn = trim((split(',', $port->{desc}->{$pl[$n]}))[0]);
my $pp = trim((split(',', $port->{desc}->{$pl[$n]}))[1]);
$pp =~ s/6//;
my $prig = trim((split(',', $port->{desc}->{$pl[$n]}))[3]);
my $plim = trim((split(',', $port->{desc}->{$pl[$n]}))[4]);
@riglim = @{setup_riglim($prig, $plim)};
# check if the network port is still listening
undef(@warning);
if($config->{os} eq "Linux") {
open(IN, "netstat -nl --$pp |");
@ -513,7 +516,7 @@ sub port_cgi {
(undef, undef, undef, $pnum) = split(' ', $_);
chomp($pnum);
$pnum =~ s/.*://;
if($pnum eq $pl[$n]) {
if($pnum eq $num) {
last;
}
}
@ -529,14 +532,14 @@ sub port_cgi {
chomp($pnum);
($pnum) = ($pnum =~ m/^.*?(\.\d+$)/);
$pnum =~ s/\.//;
if($pnum eq $pl[$n]) {
if($pnum eq $num) {
last;
}
}
}
close(IN);
}
if(lc($pcon) ne "out" && $pnum ne $pl[$n]) {
if(lc($pcon) ne "out" && $pnum ne $num) {
push(@warning, $colors->{warning_color});
}