public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <git@ipfire.org>
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. d0943219087f39fe69a47e20dff748297e4a5fb7
Date: Fri, 25 Apr 2025 12:54:05 +0000 (UTC)	[thread overview]
Message-ID: <4ZkXpj1Db2z2y6T@people01.haj.ipfire.org> (raw)

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 <michael.tremer@ipfire.org>
Date:   Fri Apr 25 14:53:47 2025 +0200

    core195: Ship network-functions.pl
    
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit 08f60babc98dad3b37c626867f2530998f5ca81c
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Fri Apr 25 14:53:07 2025 +0200

    wireguard.cgi: Normalize the pool address
    
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

-----------------------------------------------------------------------

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


                 reply	other threads:[~2025-04-25 12:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4ZkXpj1Db2z2y6T@people01.haj.ipfire.org \
    --to=git@ipfire.org \
    --cc=ipfire-scm@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