From patchwork Fri Dec 6 16:44:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 8304 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Y4cY72KdZz3wfS for ; Fri, 6 Dec 2024 16:44:27 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Y4cY52nvSz4dc; Fri, 6 Dec 2024 16:44:25 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Y4cY52K3bz32V3; Fri, 6 Dec 2024 16:44:25 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Y4cY20rSFz2xfQ for ; Fri, 6 Dec 2024 16:44:22 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "michael.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Y4cY15B5Zz1sB; Fri, 6 Dec 2024 16:44:21 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4Y4cY14BVyzTh2J; Fri, 6 Dec 2024 16:44:21 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 1/4] connections.cgi: Fix colour of destination country Date: Fri, 6 Dec 2024 16:44:14 +0000 Message-Id: <20241206164417.3840426-1-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Message-ID-Hash: SBCSOD5KVM7EIUSOKMHFELSGUQN2VHIK X-Message-ID-Hash: SBCSOD5KVM7EIUSOKMHFELSGUQN2VHIK X-MailFrom: root@michael.haj.ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Michael Tremer X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Signed-off-by: Michael Tremer Reviewed-by: Bernhard Bitsch --- html/cgi-bin/connections.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/cgi-bin/connections.cgi b/html/cgi-bin/connections.cgi index badc1f395..af375effe 100644 --- a/html/cgi-bin/connections.cgi +++ b/html/cgi-bin/connections.cgi @@ -439,7 +439,7 @@ foreach my $line () { $dport_extra - + $dstccode From patchwork Fri Dec 6 16:44:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 8305 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Y4cY7666Zz3x1C for ; Fri, 6 Dec 2024 16:44:27 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Y4cY541vmz7Ph; Fri, 6 Dec 2024 16:44:25 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Y4cY53Vg5z342K; Fri, 6 Dec 2024 16:44:25 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Y4cY217tyz2xfQ for ; Fri, 6 Dec 2024 16:44:22 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "michael.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Y4cY15mVJz2Q4; Fri, 6 Dec 2024 16:44:21 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4Y4cY14LCTzTgKx; Fri, 6 Dec 2024 16:44:21 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 2/4] connections.cgi: Ignore empty interfaces Date: Fri, 6 Dec 2024 16:44:15 +0000 Message-Id: <20241206164417.3840426-2-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241206164417.3840426-1-michael.tremer@ipfire.org> References: <20241206164417.3840426-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: SHL3KJEN654LBFOKHMMHPJDSE7A6BDCB X-Message-ID-Hash: SHL3KJEN654LBFOKHMMHPJDSE7A6BDCB X-MailFrom: root@michael.haj.ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Michael Tremer X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Parsing any custom routes for any custom interfaces was broken so that arbitrary routes were imported when not all interfaces were in use. Signed-off-by: Michael Tremer --- html/cgi-bin/connections.cgi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/html/cgi-bin/connections.cgi b/html/cgi-bin/connections.cgi index af375effe..705118576 100644 --- a/html/cgi-bin/connections.cgi +++ b/html/cgi-bin/connections.cgi @@ -89,6 +89,9 @@ my @routes = &General::system_output("ip", "route", "show"); # Find all routes foreach my $intf (keys %interfaces) { + # Skip empty interfaces + next if ($intf eq ""); + foreach my $route (grep(/dev ${intf}/, @routes)) { if ($route =~ m/^(\d+\.\d+\.\d+\.\d+\/\d+)/) { $networks{$1} = $interfaces{$intf}; From patchwork Fri Dec 6 16:44:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 8303 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Y4cY46BJcz3wfS for ; Fri, 6 Dec 2024 16:44:24 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Y4cY423Jjz2Q4; Fri, 6 Dec 2024 16:44:24 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Y4cY40snlz342K; Fri, 6 Dec 2024 16:44:24 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Y4cY20QZZz2xfQ for ; Fri, 6 Dec 2024 16:44:22 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "michael.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Y4cY169MZz2WH; Fri, 6 Dec 2024 16:44:21 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4Y4cY14W19zThh0; Fri, 6 Dec 2024 16:44:21 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 3/4] connections.cgi: Fix importing Wireguard peers Date: Fri, 6 Dec 2024 16:44:16 +0000 Message-Id: <20241206164417.3840426-3-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241206164417.3840426-1-michael.tremer@ipfire.org> References: <20241206164417.3840426-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: OMDL6G2Q4Q45UMDG6LC6457EJOELQUWB X-Message-ID-Hash: OMDL6G2Q4Q45UMDG6LC6457EJOELQUWB X-MailFrom: root@michael.haj.ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Michael Tremer X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Signed-off-by: Michael Tremer --- html/cgi-bin/connections.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/cgi-bin/connections.cgi b/html/cgi-bin/connections.cgi index 705118576..7286f9b46 100644 --- a/html/cgi-bin/connections.cgi +++ b/html/cgi-bin/connections.cgi @@ -116,13 +116,13 @@ if (-e "/var/ipfire/wireguard/peers") { &General::readhasharray("/var/ipfire/wireguard/peers", \%wgpeers); foreach my $key (keys %wgpeers) { - my $networks = $wgpeers{$key}[6]; + my $networks = $wgpeers{$key}[8]; # Split the string my @networks = split(/\|/, $networks); foreach my $network (@networks) { - $networks[$network] = ${Header::colourwg}; + $networks{$network} = ${Header::colourwg}; } } } From patchwork Fri Dec 6 16:44:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 8306 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Y4cY854xWz3wfS for ; Fri, 6 Dec 2024 16:44:28 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Y4cY65KTrz6yV; Fri, 6 Dec 2024 16:44:26 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Y4cY64pNlz32V3; Fri, 6 Dec 2024 16:44:26 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R11" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Y4cY21GPmz33Dm for ; Fri, 6 Dec 2024 16:44:22 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (secp384r1)) (Client CN "michael.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Y4cY20BLcz4ZF; Fri, 6 Dec 2024 16:44:22 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4Y4cY14hvxzThmg; Fri, 6 Dec 2024 16:44:21 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 4/4] connections.cgi: Support CIDR notation Date: Fri, 6 Dec 2024 16:44:17 +0000 Message-Id: <20241206164417.3840426-4-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241206164417.3840426-1-michael.tremer@ipfire.org> References: <20241206164417.3840426-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: 5QGFUWDBBLSFSUMJCKVNUQGCJMT5API2 X-Message-ID-Hash: 5QGFUWDBBLSFSUMJCKVNUQGCJMT5API2 X-MailFrom: root@michael.haj.ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Michael Tremer X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Signed-off-by: Michael Tremer --- html/cgi-bin/connections.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/cgi-bin/connections.cgi b/html/cgi-bin/connections.cgi index 7286f9b46..80cb4bb69 100644 --- a/html/cgi-bin/connections.cgi +++ b/html/cgi-bin/connections.cgi @@ -476,7 +476,7 @@ sub ipcolour($) { foreach my $network (@networks) { if (defined $network) { - if (&Network::check_ip_address_and_netmask($network)) { + if (&Network::check_subnet($network)) { if (&Network::ip_address_in_network($address, $network)) { return $networks{$network}; }