From patchwork Tue Dec 1 14:31:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 10938 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 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4jf3Hs3Ty2z3wh2 for ; Tue, 01 Dec 2026 14:32:09 +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) (Client CN "mail02.haj.ipfire.org", Issuer "YE2" (not verified)) by mail01.ipfire.org (Postfix) with ESMTPS id 4jf3Hq4Qc3z8Zt for ; Tue, 01 Dec 2026 14:32:07 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4jf3Hq0vJrz2xjG for ; Tue, 01 Dec 2026 14:32:07 +0000 (UTC) X-Original-To: development@lists.ipfire.org 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 raw public key) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "YR1" (not verified)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4jf3Hm1dbDz2xB9 for ; Tue, 01 Dec 2026 14:32:04 +0000 (UTC) Received: from mout-b-107.mailbox.org (mout-b-107.mailbox.org [IPv6:2001:67c:2050:102:465::107]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bit raw public key) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.mailbox.org", Issuer "Thawte TLS RSA CA G1" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4jf3Hk5n2Sz799 for ; Tue, 01 Dec 2026 14:32:02 +0000 (UTC) Authentication-Results: mail01.ipfire.org; dkim=pass header.d=mandelbit.com header.s=MBO0001 header.b=z5CRDlPY; dmarc=none; spf=pass (mail01.ipfire.org: domain of antonio@mandelbit.com designates 2001:67c:2050:102:465::107 as permitted sender) smtp.mailfrom=antonio@mandelbit.com ARC-Seal: i=1; a=rsa-sha256; d=lists.ipfire.org; s=202003rsa; cv=none; t=1796135524; b=Zlro6efBgGZxXOuAxDho4mrlcIfKqR3YjYPriG6zu92211anzzsR8HUNaBq8zPF4Hz8hg7 lLqoogWu4Kby/6+oiENmrSLloTI1N2AT3/SpHNNspY6KQ9gFkC39g76+1V3Kn2mD4PNnjv UrTVrPQBFrpXJr7GwdOQcr8vDCkuGwUsxxbqYyA4PbyKpkpMro2WA0Zt7jP3r0cKuAugig chowy04CoJIOB4XLn8K08BT1uczkSEip6EnLzqiod7hD9KFI99f7RK++WlgZMb0FmfnzZn DhAUjc0fxcB+fPC1G747KktMxCXwRY2N101ulEZepltTSBWh1Sgs9zIWGLPuZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1796135524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=07DV5dc2qDT/VJSyhJAVOtXo1iQTiA26Ls930Bg2Bws=; b=dZgWlG2YvZCpAQxTQBUM/hAENqjWDSU00ujEkkrQMrHcheVkFifi6rBVzus7AqOWpNHAvN n7YFsRdBnXu+RYChk1U37u5xGJ8LdLey17yFk/N6Z/rgdGubFLNWOmLG8p2ljgKK449yix qGBNjUUU0ffBEVoK1CePQuTXd05zai+7Ychd4sesjkfxQr9q/fvGu7xw0mUce/iOOOys3g h6Ya4cXkQiMmEhdmfWDyyBrzRiQYyswhk5zXCPd7vsYbnSv82GSroIlYutobFUwe1qwI41 mjZUKGpL5k3Tz940rxkYNGtwQUyUMW5vOoiuOxykoR7vhy1RmVLmXD4Z2juilg== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=mandelbit.com header.s=MBO0001 header.b=z5CRDlPY; dmarc=none; spf=pass (mail01.ipfire.org: domain of antonio@mandelbit.com designates 2001:67c:2050:102:465::107 as permitted sender) smtp.mailfrom=antonio@mandelbit.com Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-b-107.mailbox.org (Postfix) with ESMTPS id 4jf3Hh2Cb2z3y2n; Tue, 01 Dec 2026 15:32:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1796135520; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=07DV5dc2qDT/VJSyhJAVOtXo1iQTiA26Ls930Bg2Bws=; b=z5CRDlPYylANuTTyV7MMI0mI2HX9g4FgyaO7ajy5ZDtg07Rv/pD6XIRkoOJRtOjJBCJgOv JY0pIvKIovCKWMMBVJxKm/v+8LS3cgWmRE2XndUVSMtwgpUuxg7STqFYqItHQV3zHuyu7o pvhpYC68pVkSW7hULx2tRlTY5HAPFwbofFDEvXXSN6LNOgKv9YNdOmHujRqUmCxN0XczK/ CGF/ZuyAjnWznZITHr9OKTVyJD6Okmr8c9eeq/QZAG8AF/M9vjpqhk4G18Jhsy84aQe+ph tZ/1uHJbNNjbuTQ4P9T/dw6bUaW+daamb/1OukLrJePeD3kQo75+n9xXuCVknw== From: Antonio Quartulli To: development@lists.ipfire.org Cc: Antonio Quartulli Subject: [PATCH 3/4] ddns.cgi: Get the address of the DDNS hosts only when needed Date: Tue, 1 Dec 2026 15:31:52 +0100 Message-ID: <20261201143155.1798388-4-antonio@mandelbit.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261201143155.1798388-1-antonio@mandelbit.com> References: <20261201143155.1798388-1-antonio@mandelbit.com> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 X-Rspamd-Action: no action X-Spamd-Result: default: False [-5.20 / 11.00]; NEURAL_HAM(-3.00)[-1.000]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:67c:2050::/48]; R_DKIM_ALLOW(-0.10)[mandelbit.com:s=MBO0001]; RCVD_IN_DNSWL_LOW(-0.10)[2001:67c:2050:b231:465::102:received]; R_DKIM_ALIGNED(-0.10)[strict]; MX_GOOD(-0.10)[mxext3.mailbox.org]; MIME_GOOD(-0.10)[text/plain]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[mandelbit.com]; IP_REPUTATION_HAM(0.00)[asn: 199118(-0.35),country: DE(-0.01),ip: 2001:67c:2050:102::(0.00)]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[mandelbit.com:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; DKIM_REPUTATION(0.00)[0]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:199118,ipnet:2001:67c:2050::/48,country:DE]; FROM_HAS_DN(0.00)[] X-Rspamd-Server: mail01.haj.ipfire.org X-Rspamd-Queue-Id: 4jf3Hk5n2Sz799 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 --- html/cgi-bin/ddns.cgi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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"); }