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 4bVZ7p0FFGz2xph for ; Sun, 29 Jun 2025 16:12:38 +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 4bVZ7k3ST1z2xh0 for ; Sun, 29 Jun 2025 16:12:34 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4bVZ7j5pbbzkc; Sun, 29 Jun 2025 16:12:33 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1751213553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OG4kvfHJzS0gux+9S3t/0NJ8slAoqu2zQRv4UNdpQGs=; b=HkWLoqMfVlOPqewOmAKQhyYFHCgj5VUoVDp41zuBI8zdSZOfyJU1JAcSnO7/M4HOl2TJdQ Viq5g6sXsDRO5jAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1751213553; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OG4kvfHJzS0gux+9S3t/0NJ8slAoqu2zQRv4UNdpQGs=; b=Nh4UBMMu+9oou4BEyTsSFQ0ev1SnzCTqwlmE+bYk2iLxgXxaNHJu55HlxOCO1ACHhBA09/ ju1Qb83oQnAGYuHuOXnGaWL0svfM5ajcatSHru8HA2cAO6Mm3BN79FmbdZAEMQ5mp1zSd/ XosEoZI45bmF99DarxnZyrPggeQaFopYJTGnA+n5bDyZNtoA5n962aoBOtWIb03WWYopll 8I/OURDU+lvSEf9tish/yE6yuNkEHTDRx4hDCk1ef7nFjZWWxzMJCDk0tmLPjmVrxYO0k6 W4S1JuNLxAy6kC5yUnIxucVnotxT6oxWv3kMJWRZWWmYWAQ94C85s+QymQ/WzA== Content-Type: text/plain; charset=us-ascii Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: Mime-Version: 1.0 Subject: Re: [PATCH 1/2] libloc: Fixes bug13861 - libloc-0.9.18 fails to find some ASN info From: Michael Tremer In-Reply-To: <20250627195351.3341456-1-adolf.belka@ipfire.org> Date: Sun, 29 Jun 2025 17:12:33 +0100 Cc: development@lists.ipfire.org Content-Transfer-Encoding: quoted-printable Message-Id: <6012C99C-7432-4D4F-8AAC-449A0FB2E46C@ipfire.org> References: <20250627195351.3341456-1-adolf.belka@ipfire.org> To: Adolf Belka Thank you for submitting this. This was a very interesting find. > On 27 Jun 2025, at 20:53, Adolf Belka wrote: >=20 > - Patch added to fix bactracking after no match found bug. When the = next version of > libloc is released then this patch can be removed as the patch will = be integrated in > with that version. > - Update of rootfile not required. > - Tested out on local build of libloc-0.9.18 >=20 > Fixes: bug13861 > Reported-by: Adolf Belka > Suggested-by: Michael Tremer > Tested-by: Adolf Belka > Signed-off-by: Adolf Belka > --- > lfs/libloc | 1 + > ...tch_was_found_at_the_end_of_the_tree.patch | 31 +++++++++++++++++++ > 2 files changed, 32 insertions(+) > create mode 100644 = src/patches/libloc-0.9.18_Fix_backtracking_after_no_match_was_found_at_the= _end_of_the_tree.patch >=20 > diff --git a/lfs/libloc b/lfs/libloc > index f2f0aa8a9..e9bbe16ba 100644 > --- a/lfs/libloc > +++ b/lfs/libloc > @@ -82,6 +82,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) > # = https://lists.ipfire.org/pipermail/development/2022-November/014763.html > cd $(DIR_APP) && patch -Np1 < = $(DIR_SRC)/src/patches/libloc-0.9.18-Revert-Install-Perl-files-to-Perl-ven= dor-directory.patch > cd $(DIR_APP) && patch -Np1 < = $(DIR_SRC)/src/patches/libloc-0.9.18_gettext-0.25_fix.patch > + cd $(DIR_APP) && patch -Np1 < = $(DIR_SRC)/src/patches/libloc-0.9.18_Fix_backtracking_after_no_match_was_f= ound_at_the_end_of_the_tree.patch > cd $(DIR_APP) && ./autogen.sh > cd $(DIR_APP) && ./configure \ > --prefix=3D/usr \ > diff --git = a/src/patches/libloc-0.9.18_Fix_backtracking_after_no_match_was_found_at_t= he_end_of_the_tree.patch = b/src/patches/libloc-0.9.18_Fix_backtracking_after_no_match_was_found_at_t= he_end_of_the_tree.patch > new file mode 100644 > index 000000000..6ac9acf3c > --- /dev/null > +++ = b/src/patches/libloc-0.9.18_Fix_backtracking_after_no_match_was_found_at_t= he_end_of_the_tree.patch > @@ -0,0 +1,31 @@ > +X-Git-Url: = http://git.ipfire.org/?p=3Dlocation%2Flibloc.git;a=3Dblobdiff_plain;f=3Dsr= c%2Fdatabase.c;h=3Dc251061cc8a254879491ebe133b1b4f3b58ddf30;hp=3D0c8608542= aaad6e82c4d8602bbeb388ab43225bb;hb=3D95d271bb90b4cebe81c288a95a2336aa63bac= 4d7;hpb=3Dd1120513a30de43308d9ed848f7ef3c6ede6d767 > + > +diff --git a/src/database.c b/src/database.c > +index 0c86085..c251061 100644 > +--- a/src/database.c > ++++ b/src/database.c > +@@ -907,13 +907,7 @@ static int __loc_database_lookup(struct = loc_database* db, const struct in6_addr* > +=20 > + // Move on to the next node > + r =3D __loc_database_lookup(db, address, network, network_address, = node_index, level + 1); > +- > +- // End here if a result was found > +- if (r =3D=3D 0) > +- return r; > +- > +- // Raise any errors > +- else if (r < 0) > ++ if (r < 0) > + return r; > +=20 > + DEBUG(db->ctx, "No match found below level %u\n", level); > +@@ -922,7 +916,7 @@ static int __loc_database_lookup(struct = loc_database* db, const struct in6_addr* > + } > +=20 > + // If this node has a leaf, we will check if it matches > +- if (__loc_database_node_is_leaf(node_v1)) { > ++ if (!*network && __loc_database_node_is_leaf(node_v1)) { > + r =3D __loc_database_lookup_handle_leaf(db, address, network, = network_address, level, node_v1); > + if (r < 0) > + return r; > + > --=20 > 2.50.0 >=20