From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4ZkXpk1JRtz331s for ; Fri, 25 Apr 2025 12:54:06 +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 "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4ZkXpk11ZQz32dy for ; Fri, 25 Apr 2025 12:54:06 +0000 (UTC) Received: from people01.haj.ipfire.org (people01.haj.ipfire.org [172.28.1.161]) (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 "people01.haj.ipfire.org", Issuer "E6" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4ZkXpj2L0YzQJ for ; Fri, 25 Apr 2025 12:54:05 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1745585645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc; bh=DQTO5EfhzmKSfynTdW8VJ754iG9lOWyDgOV+d7jVSbU=; b=QcHolRv55xokIMnAHu4xRuVd1hRGy7omMGHTbItDzBfEivNrQzA0HspjgCMeJDXVQO908s wibQsNXGiv38U3CA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1745585645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc; bh=DQTO5EfhzmKSfynTdW8VJ754iG9lOWyDgOV+d7jVSbU=; b=v9U/I5t6hvZI73ceYrnYZKg9dr/qGwvUhtgJ9tZh7DBZL5Hf+sAGRufjdUO4Imok9Gr0ev +lKzHfIEj//KijoJEIUkitTavfZ48f24xgH+7Msywpi1X6ILX0YouTQi+4exdaLJnRwZAv k491MPvD0WRLkFE1cIuA+t/Iv/oyVp+eR/yqi2aCNF0kZ2b6VB8SQvYUNWNlBjzpa7IQta yl6ROJDW24SHvAx9v61j/SeYFgkkxz+vA5hrcXYWl5xkBwFV5QUZhob628OWI8Ct/0bC8X am9ZkTodK8JK9gHIAohQeRiB1lUpACfkHsQxRL2zOx43/dNahuqh611s+LacGA== Received: by people01.haj.ipfire.org (Postfix, from userid 1000) id 4ZkXpj1Db2z2y6T; Fri, 25 Apr 2025 12:54:05 +0000 (UTC) To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. d0943219087f39fe69a47e20dff748297e4a5fb7 X-Git-Refname: refs/heads/next X-Git-Reftype: branch X-Git-Oldrev: f4fa8b317d41fa5650ddcad5d42cdee1affc51e5 X-Git-Newrev: d0943219087f39fe69a47e20dff748297e4a5fb7 Message-Id: <4ZkXpj1Db2z2y6T@people01.haj.ipfire.org> Date: Fri, 25 Apr 2025 12:54:05 +0000 (UTC) From: Michael Tremer Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree". The branch, next has been updated via d0943219087f39fe69a47e20dff748297e4a5fb7 (commit) via 08f60babc98dad3b37c626867f2530998f5ca81c (commit) from f4fa8b317d41fa5650ddcad5d42cdee1affc51e5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d0943219087f39fe69a47e20dff748297e4a5fb7 Author: Michael Tremer Date: Fri Apr 25 14:53:47 2025 +0200 core195: Ship network-functions.pl Signed-off-by: Michael Tremer commit 08f60babc98dad3b37c626867f2530998f5ca81c Author: Michael Tremer Date: Fri Apr 25 14:53:07 2025 +0200 wireguard.cgi: Normalize the pool address Signed-off-by: Michael Tremer ----------------------------------------------------------------------- Summary of changes: config/cfgroot/network-functions.pl | 13 +++++++++++++ config/rootfiles/core/195/filelists/files | 1 + html/cgi-bin/wireguard.cgi | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) Difference in files: diff --git a/config/cfgroot/network-functions.pl b/config/cfgroot/network-functions.pl index 37a436253..ad89fc777 100644 --- a/config/cfgroot/network-functions.pl +++ b/config/cfgroot/network-functions.pl @@ -331,6 +331,19 @@ sub get_netmask($) { return &convert_prefix2netmask($prefix); } +sub normalize_network($) { + my $network = shift; + + my $address = &get_netaddress($network); + my $prefix = &get_prefix($network); + + unless (defined $address && defined $prefix) { + return undef; + } + + return "${address}/${prefix}"; +} + # Returns True if $address is in $network. sub ip_address_in_network($$) { my $address = shift; diff --git a/config/rootfiles/core/195/filelists/files b/config/rootfiles/core/195/filelists/files index f09b4650e..75d499f35 100644 --- a/config/rootfiles/core/195/filelists/files +++ b/config/rootfiles/core/195/filelists/files @@ -22,4 +22,5 @@ var/ipfire/http-client-functions.pl var/ipfire/ids-functions.pl var/ipfire/ipblocklist/sources var/ipfire/menu.d/40-services.menu +var/ipfire/network-functions.pl var/ipfire/wireguard-functions.pl diff --git a/html/cgi-bin/wireguard.cgi b/html/cgi-bin/wireguard.cgi index cc79347a6..6213fd342 100644 --- a/html/cgi-bin/wireguard.cgi +++ b/html/cgi-bin/wireguard.cgi @@ -68,7 +68,7 @@ if ($cgiparams{"ACTION"} eq $Lang::tr{'save'}) { if (&Wireguard::pool_is_in_use($Wireguard::settings{'CLIENT_POOL'})) { # Ignore any changes if the pool is in use } elsif (&Network::check_subnet($cgiparams{'CLIENT_POOL'})) { - $Wireguard::settings{'CLIENT_POOL'} = $cgiparams{'CLIENT_POOL'}; + $Wireguard::settings{'CLIENT_POOL'} = &Network::normalize_network($cgiparams{'CLIENT_POOL'}); } elsif ($cgiparams{'CLIENT_POOL'} ne '') { push(@errormessages, $Lang::tr{'wg invalid client pool'}); } hooks/post-receive -- IPFire 2.x development tree