With libloc-0.9.17 running the command location lookup 104.18.203.90 gives 104.18.203.90: Network : 104.16.0.0/12 Country : United States of America Autonomous System : AS13335 - Cloudflare, Inc. Anycast : yes with libloc-0.9.18 you get Nothing found for 104.18.203.90 The IP is for www.clamav.net The same happens with their second IP and also with the IP for archlinux.org These are the two websites that I happened to find having the problem. Majority I have tried work fine but there could be more depending on what causes the issue to occur in libloc-0.9.18 This was also confirmed on a local build of libloc-0.9.18 which gave the same result. As libloc-0.9.18 was not shipped when it was merged then any user doing upgrades from a system that was installed earlier than CU193 will still be running with libloc-0.9.17 Any user doing a fresh install with CU193 or later will have libloc-0.9.18 installed.
Which version of the database have you been testing this against?
The good and bad result that I mention in the description were both done with the same database version which was -bash-5.2$ location version Fri, 27 Jun 2025 04:42:16 GMT
In my earlier faultfinding I also tested out various older databases back to 2025-01-01 and got the same result.
http://git.ipfire.org/?p=people/ms/libloc.git;a=commit;h=95d271bb90b4cebe81c288a95a2336aa63bac4d7 Author: Michael Tremer <michael.tremer@ipfire.org> database: Fix backtracking after no match was found at the end of the tree This is a rare bug which only appears if the tree has not been 100% optimised which might happen because it would not be worth the effort to remove all dead ends all of the time. Therefore, we could be reaching a node which is not an actual leaf but still not find our network. In that case, we will have to go backwards slightly to check if there has been a less specific match (but a match nonetheless). This was broken in commit 9e72b8a0c56403ca7d23c6a767d66038e0d63c14 when the return code for no match was changed to zero. Fixes: #13861 - libloc-0.9.18 fails to find some ASN info Reported-by: Adolf Belka <adolf.belka@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Hello Adolf, thank you for posting such an interesting problem. It has indeed been a problem in the lookup algorithm which terminated too early and did not perform any backtracking. This patch should fix the problem: > https://git.ipfire.org/?p=location/libloc.git;a=commitdiff;h=95d271bb90b4cebe81c288a95a2336aa63bac4d7 Please let me know if this fixes the problem for you, too.
I did the local build of libloc on my desktop machine again but this time with your patch also applied. Can confirm that after this both the Clamav IP's and the Archlinux one all get asn responses back.
The fix patch has been sent to the dev mailing list to apply to the existing version of libloc so a new version does not have to be created. https://lists.ipfire.org/development/20250627195351.3341456-1-adolf.belka@ipfire.org/T/#t https://patchwork.ipfire.org/project/ipfire/list/?series=5007
https://www.ipfire.org/blog/ipfire-2-29-core-update-196-is-available-for-testing
Have tested out running location lookup with the two IP's from www.clamav.net and with the IP from archlinux.org In all cases location lookup gives the expected feedback. This verifies that the fix is in CU196 Testing.