From: "Peter Müller" <peter.mueller@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH] fwhosts.cgi: properly fetch configured IPsec N2N subnets
Date: Thu, 22 Apr 2021 22:20:00 +0200 [thread overview]
Message-ID: <ac8e8aff-b4fb-3392-8d25-c85f9d286ca2@ipfire.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]
Previously, the getcolor() function did not correctly process IPsec
N2N connections with more than one remote network configured, resulting
in networks mistakenly marked as being part of a VPN connection, or vice
versa.
Fixes: #11235
Signed-off-by: Peter Müller <peter.mueller(a)ipfire.org>
---
html/cgi-bin/fwhosts.cgi | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi
index 84b018459..648fc7c8e 100644
--- a/html/cgi-bin/fwhosts.cgi
+++ b/html/cgi-bin/fwhosts.cgi
@@ -1974,11 +1974,13 @@ sub getcolor
#Check if IP is part of a IPsec N2N network
foreach my $key (sort keys %ipsecconf){
if ($ipsecconf{$key}[11]){
- my ($a,$b) = split("/",$ipsecconf{$key}[11]);
- $b=&General::iporsubtodec($b);
- if (&General::IpInSubnet($sip,$a,$b)){
- $tdcolor="<font style='color: $Header::colourvpn;'>$c</font>";
- return $tdcolor;
+ foreach my $ipsecsubitem (split(/\|/, $ipsecconf{$key}[11])) {
+ my ($a,$b) = split("/",$ipsecsubitem);
+ $b=&General::iporsubtodec($b);
+ if (&General::IpInSubnet($sip,$a,$b)){
+ $tdcolor="<font style='color: $Header::colourvpn;'>$c</font>";
+ return $tdcolor;
+ }
}
}
}
--
2.26.2
next reply other threads:[~2021-04-22 20:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-22 20:20 Peter Müller [this message]
2021-07-15 15:49 ` Stefan Schantl
2021-07-15 15:50 ` Michael Tremer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ac8e8aff-b4fb-3392-8d25-c85f9d286ca2@ipfire.org \
--to=peter.mueller@ipfire.org \
--cc=development@lists.ipfire.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox