public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
* [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 5919e63e27cd7b6462bff637f0dd98e639c86f4f
@ 2026-12-01 17:59 Michael Tremer
  0 siblings, 0 replies; only message in thread
From: Michael Tremer @ 2026-12-01 17:59 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  5919e63e27cd7b6462bff637f0dd98e639c86f4f (commit)
       via  98a0c2d18796815f1bd41186693bd38ad69698c9 (commit)
       via  f1f7e1629e8dc0c3868ddfc578c3bd4babe82e81 (commit)
       via  ba03ea60817f28fc31ee9fe33690f3dcc130b87a (commit)
       via  052996cff73095a3b6cf18cb239ef88ff91a5864 (commit)
      from  b679d0a3b4454b3563dac9cfacf659eaca50fb72 (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 5919e63e27cd7b6462bff637f0dd98e639c86f4f
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Tue Dec 1 17:48:20 2026 +0000

    telemetry: Update to snapshot 467953a
    
    * Databases are being migrated before graphs are rendered. Graphs of
      databases that were missing data sources (for example the OpenVPN
      net-to-net connections that have been migrated from collectd) could
      not be rendered until something was written to them
    * The labels of the vertical axis of graphs are spaced by the height of
      the text, and there is more room below the title
    * The minimum and maximum lines of the CPU frequency graph are thinner
    * The translations have been updated
    
    Fixes: #14962
    Fixes: #14967
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit 98a0c2d18796815f1bd41186693bd38ad69698c9
Author: Antonio Quartulli <antonio@mandelbit.com>
Date:   Tue Dec 1 15:31:53 2026 +0100

    http-client-functions.pl: Use the address ddns publishes for the sync check
    
    GetDyndnsRedIP() only fetched the public address if "Fetch the public
    IP" was selected and RED was in RFC1918 or the shared address space.
    ddns uses it whenever fetching is selected, and when RED can't be
    reached from the Internet, e.g. in 169.254.0.0/16, so the web interface
    showed those hosts as out of sync. With RED behind a router, the page
    now fetches the address like ddns does.
    
    Bug: #14766
    Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit f1f7e1629e8dc0c3868ddfc578c3bd4babe82e81
Author: Antonio Quartulli <antonio@mandelbit.com>
Date:   Tue Dec 1 15:31:52 2026 +0100

    ddns.cgi: Get the address of the DDNS hosts only when needed
    
    GetDyndnsRedIP() can fetch the public address from a server, which was
    done on every page load, even without any enabled host.
    
    Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit ba03ea60817f28fc31ee9fe33690f3dcc130b87a
Author: Antonio Quartulli <antonio@mandelbit.com>
Date:   Tue Dec 1 15:31:51 2026 +0100

    wio.cgi: Get the address of the DDNS hosts only once
    
    GetDyndnsRedIP() can fetch the public address from a server, which was
    done for each enabled host.
    
    Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

commit 052996cff73095a3b6cf18cb239ef88ff91a5864
Author: Antonio Quartulli <antonio@mandelbit.com>
Date:   Tue Dec 1 15:31:50 2026 +0100

    network-functions.pl: Add ip_address_is_global()
    
    Returns whether an IPv4 address can be reached from the Internet, based
    on the IANA special-purpose address registry.
    
    Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

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

Summary of changes:
 config/cfgroot/http-client-functions.pl | 26 ++++++++++----------------
 config/cfgroot/network-functions.pl     | 29 +++++++++++++++++++++++++++++
 html/cgi-bin/ddns.cgi                   |  6 ++++--
 html/cgi-bin/wio.cgi                    |  6 +++++-
 lfs/telemetry                           |  4 ++--
 5 files changed, 50 insertions(+), 21 deletions(-)

Difference in files:
diff --git a/config/cfgroot/http-client-functions.pl b/config/cfgroot/http-client-functions.pl
index aefad7639..6a0a0fa4d 100644
--- a/config/cfgroot/http-client-functions.pl
+++ b/config/cfgroot/http-client-functions.pl
@@ -313,7 +313,7 @@ sub FetchPublicIp {
 }
 
 #
-# This sub returns the red IP used to compare in DyndnsServiceSync
+# This sub returns the address that ddns publishes, to compare in DyndnsServiceSync
 #
 sub GetDyndnsRedIP {
 	my %settings;
@@ -322,21 +322,15 @@ sub GetDyndnsRedIP {
 	&General::readhash("${General::swroot}/ddns/settings", \%settings);
 
 	# Try to grab the address from the local-ipaddress file.
-	my $ip = &Network::grab_address_from_file("${General::swroot}/red/local-ipaddress") or return 'unavailable';
-
-	# 100.64.0.0/10 is reserved for dual-stack lite (http://tools.ietf.org/html/rfc6598).
-	if (&Network::ip_address_in_network($ip, "10.0.0.0/255.0.0.0") ||
-		&Network::ip_address_in_network($ip, "172.16.0.0/255.240.0.0") ||
-		&Network::ip_address_in_network($ip, "192.168.0.0/255.255.0.0") ||
-		&Network::ip_address_in_network($ip, "100.64.0.0/255.192.0.0"))
-	{
-		if ($settings{'BEHINDROUTER'} eq 'FETCH_IP') {
-			# Call function to omit the real address.
-			my $RealIP = &FetchPublicIp;
-
-			# Check if the grabbed address is valid.
-			$ip = (&Network::check_ip_address ($RealIP) ?  $RealIP : 'unavailable');
-		}
+	my $ip = &Network::grab_address_from_file("${General::swroot}/red/local-ipaddress");
+
+	# Like ddns, use the public address if asked to, or if RED is unknown or
+	# can't be reached from the Internet
+	if ($settings{'BEHINDROUTER'} eq 'FETCH_IP' || !&Network::ip_address_is_global($ip)) {
+		my $RealIP = &FetchPublicIp;
+
+		# Check if the grabbed address is valid.
+		$ip = (&Network::check_ip_address ($RealIP) ?  $RealIP : 'unavailable');
 	}
 
 	return $ip;
diff --git a/config/cfgroot/network-functions.pl b/config/cfgroot/network-functions.pl
index a90655305..9f37c490f 100644
--- a/config/cfgroot/network-functions.pl
+++ b/config/cfgroot/network-functions.pl
@@ -425,6 +425,23 @@ sub ip_address_in_range($$) {
 	return (($ipaddress_bin >= $ipstart_bin) && ($ipaddress_bin <= $ipend_bin));
 }
 
+# Returns true if the IPv4 address can be reached from the Internet, i.e. it
+# isn't in any of the special-purpose ranges that aren't globally reachable
+# (based on the IANA registry).
+sub ip_address_is_global($) {
+	my $address = shift;
+
+	return 0 unless (&check_ip_address($address));
+
+	foreach my $network ("0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8",
+			"169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.2.0/24", "192.168.0.0/16",
+			"198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4") {
+		return 0 if (&ip_address_in_network($address, $network));
+	}
+
+	return 1;
+}
+
 sub check_port
 {
 	$_ = $_[0];
@@ -1022,6 +1039,18 @@ sub testsuite() {
 	$result = &ip_address_in_range("192.168.30.21", "192.168.30.10", "192.168.30.20");
 	assert('ip_address_in_range("192.168.30.21", "192.168.30.10", "192.168.30.20")', !$result);
 
+	# Check &ip_address_is_global()
+	foreach my $address ("81.3.27.37", "8.8.8.8", "1.0.0.0", "100.63.255.255", "100.128.0.0",
+			"169.253.255.255", "172.15.255.255", "172.32.0.0", "224.0.0.1", "239.255.255.255") {
+		assert("ip_address_is_global(\"$address\")", &ip_address_is_global($address));
+	}
+
+	foreach my $address ("10.1.2.3", "172.16.0.0", "172.31.255.255", "192.168.1.1", "100.64.0.0",
+			"100.127.255.255", "127.0.0.1", "169.254.0.0", "169.254.255.255", "0.255.255.255",
+			"192.0.2.1", "198.18.0.1", "240.0.0.0", "255.255.255.255", "a.b.c.d", "") {
+		assert("!ip_address_is_global(\"$address\")", !&ip_address_is_global($address));
+	}
+
 	# Check &get_prefix()
 	$result = &get_prefix("192.168.0.0/24");
 	assert('get_prefix("192.168.0.0/24")', $result == 24);
diff --git a/html/cgi-bin/ddns.cgi b/html/cgi-bin/ddns.cgi
index e5fe7166f..2c075a4c8 100644
--- a/html/cgi-bin/ddns.cgi
+++ b/html/cgi-bin/ddns.cgi
@@ -445,8 +445,9 @@ print $form->render();
 -e $datafile or die "Unable to open $datafile.";
 @current = &General::read_file($datafile, { keep_newlines => 1 });
 
-# Get IP address of the red interface.
-my $ip = &HTTPClient::GetDyndnsRedIP();
+# The address of the hosts, which may have to be fetched from a server: only
+# get it when needed
+my $ip;
 my $id = 0;
 my $toggle_enabled;
 
@@ -484,6 +485,7 @@ if (@current) {
 			$fqdn =~ s/^[\*\@]\.//;
 
 			if (&Network::check_fqdn($fqdn)) {
+				$ip //= &HTTPClient::GetDyndnsRedIP();
 				$sync = (&HTTPClient::DyndnsServiceSync ($ip,$temp[1], $temp[2]) ? "has-text-success" : "has-text-danger");
 			}
 
diff --git a/html/cgi-bin/wio.cgi b/html/cgi-bin/wio.cgi
index 35e8ff041..8a229c92b 100755
--- a/html/cgi-bin/wio.cgi
+++ b/html/cgi-bin/wio.cgi
@@ -1030,6 +1030,9 @@ my @dyndnsnames = ();
 if ( -s "$dyndnsconfig" ) {
 	@ddns = &General::read_file($dyndnsconfig);
 
+	# May have to be fetched from a server: only do it once
+	my $ddnsip;
+
 	foreach (@ddns) {
 		chomp;
 		@temp = split (/\,/, $_);
@@ -1037,7 +1040,8 @@ if ( -s "$dyndnsconfig" ) {
 		my $class = "has-text-info";
 
 		if ( $temp[7] eq "on" ) {
-			$class = ( &HTTPClient::DyndnsServiceSync (&HTTPClient::GetDyndnsRedIP,$temp[1],$temp[2]) ? "has-text-success" : "has-text-danger" );
+			$ddnsip //= &HTTPClient::GetDyndnsRedIP();
+			$class = ( &HTTPClient::DyndnsServiceSync ($ddnsip,$temp[1],$temp[2]) ? "has-text-success" : "has-text-danger" );
 		}
 
 		push(@dyndnsnames, "<span class='$class'>@{[ &Header::escape($temp[1]) ]}.@{[ &Header::escape($temp[2]) ]}</span>");
diff --git a/lfs/telemetry b/lfs/telemetry
index 44a53136c..b056143d6 100644
--- a/lfs/telemetry
+++ b/lfs/telemetry
@@ -25,7 +25,7 @@
 include Config
 
 # This is a development snapshot (there is no release, yet)
-VER        = 0.99.0-git20261031-5189d70
+VER        = 0.99.0-git20261201-467953a
 
 THISAPP    = telemetry-$(VER)
 DL_FILE    = $(THISAPP).tar.xz
@@ -41,7 +41,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE) = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_BLAKE2 = a2ca6114e8e5b176cd33074abf84b76a20f04bf4356496c1b5e95bd8cfad4ed14b0245a0957dfd1acec87fa44a2ed1a3dfe7a0f165ba43802258e2d4ee05bb16
+$(DL_FILE)_BLAKE2 = 84e0d18c213232e846de96e8b2459026d587c0dd0e6e39e781abb2fbbda5271fbc91c0848112af72bd6a3e6fb8c1ec1d03b08f5b272606bfa86e23d6e8d73df2
 
 install : $(TARGET)
 


hooks/post-receive
--
IPFire 2.x development tree


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-12-01 17:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01 17:59 [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 5919e63e27cd7b6462bff637f0dd98e639c86f4f Michael Tremer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox