* [git.ipfire.org] IPFire 2.x development tree branch, next, updated. d0943219087f39fe69a47e20dff748297e4a5fb7
@ 2025-04-25 12:54 Michael Tremer
0 siblings, 0 replies; only message in thread
From: Michael Tremer @ 2025-04-25 12:54 UTC (permalink / raw)
To: ipfire-scm
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-25 12:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-25 12:54 [git.ipfire.org] IPFire 2.x development tree branch, next, updated. d0943219087f39fe69a47e20dff748297e4a5fb7 Michael Tremer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox