asyn-thrdd: retry link-local ipv6 if missing scope id

When the threaded resolver gets AAAA results that carry a link-local
address without scope-id, it now re-queues a query with AF_UNSPEC and
strips ipv4 addresses from that result. Whatever the resulting addresses
and scope-ids are, this becomes the result of the resolve.

Fixes #22330
Reported-by: Bartel Sielski
Closes #22368
This commit is contained in:
Stefan Eissing 2026-07-21 13:28:59 +02:00 committed by Daniel Stenberg
parent 489a4c1b48
commit 545cdd4b50
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
8 changed files with 194 additions and 66 deletions

View file

@ -88,7 +88,7 @@ static CURLcode test_unit3301(const char *arg)
/* create and teardown queue */
memset(&ctx, 0, sizeof(ctx));
result = Curl_thrdq_create(&tqueue, "unit3301-a", 0, 0, 2, 1,
result = Curl_thrdq_create(&tqueue, "unit3301-a", 0, 2, 1,
unit3301_item_free, unit3301_process,
unit3301_event, &ctx);
fail_unless(!result, "queue-a create");
@ -99,7 +99,7 @@ static CURLcode test_unit3301(const char *arg)
/* create queue, have it process `count` items */
count = 10;
memset(&ctx, 0, sizeof(ctx));
result = Curl_thrdq_create(&tqueue, "unit3301-b", 0, 0, 2, 1,
result = Curl_thrdq_create(&tqueue, "unit3301-b", 0, 2, 1,
unit3301_item_free, unit3301_process,
unit3301_event, &ctx);
fail_unless(!result, "queue-b create");

View file

@ -76,7 +76,7 @@ static CURLcode test_unit3306(const char *arg)
fail_unless(getenv("CURL_DBG_THRDPOOL_FAIL_STARTS"),
"CURL_DBG_THRDPOOL_FAIL_STARTS must be set for this test");
result = Curl_thrdq_create(&tqueue, "unit3306", 0, 0, 2, 1,
result = Curl_thrdq_create(&tqueue, "unit3306", 0, 2, 1,
unit3306_item_free, unit3306_process,
NULL, NULL);
fail_unless(!result, "queue create");