mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-13 20:42:58 +02:00
connections.cgi: Fix broken NAT rules when there is an empty destination IP address
Bug introduced with e60cd3a404
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Reported-by: Daniel Weismüller <daniel.weismueller@ipfire.org>
This commit is contained in:
@@ -540,7 +540,7 @@ foreach my $line (@conntrack) {
|
||||
$ttl = format_time($ttl);
|
||||
|
||||
my $sip_extra;
|
||||
if ($sip ne $sip_ret) {
|
||||
if ($sip_ret && $sip ne $sip_ret) {
|
||||
$sip_extra = "<span style='color:#FFFFFF;'>></span> ";
|
||||
$sip_extra .= "<a href='/cgi-bin/ipinfo.cgi?ip=$sip_ret'>";
|
||||
$sip_extra .= " <span style='color:#FFFFFF;'>$sip_ret</span>";
|
||||
@@ -548,7 +548,7 @@ foreach my $line (@conntrack) {
|
||||
}
|
||||
|
||||
my $dip_extra;
|
||||
if ($dip ne $dip_ret) {
|
||||
if ($dip_ret && $dip ne $dip_ret) {
|
||||
$dip_extra = "<span style='color:#FFFFFF;'>></span> ";
|
||||
$dip_extra .= "<a href='/cgi-bin/ipinfo.cgi?ip=$dip_ret'>";
|
||||
$dip_extra .= " <span style='color:#FFFFFF;'>$dip_ret</span>";
|
||||
@@ -661,15 +661,17 @@ sub ipcolour($) {
|
||||
my ($ip) = $_[0];
|
||||
my $found = 0;
|
||||
|
||||
foreach my $line (@network) {
|
||||
if ($network[$id] eq '') {
|
||||
$id++;
|
||||
} else {
|
||||
if (!$found && ipv4_in_network($network[$id], $masklen[$id], $ip) ) {
|
||||
$found = 1;
|
||||
$colour = $colour[$id];
|
||||
if ($ip) {
|
||||
foreach my $line (@network) {
|
||||
if ($network[$id] eq '') {
|
||||
$id++;
|
||||
} else {
|
||||
if (!$found && ipv4_in_network($network[$id], $masklen[$id], $ip) ) {
|
||||
$found = 1;
|
||||
$colour = $colour[$id];
|
||||
}
|
||||
$id++;
|
||||
}
|
||||
$id++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user