noproxy: support proxies specified using cidr notation

For both IPv4 and IPv6 addresses. Now also checks IPv6 addresses "correctly"
and not with string comparisons.

Split out the noproxy checks and functionality into noproxy.c

Added unit test 1614 to verify checking functions.

Reported-by: Mathieu Carbonneaux

Fixes #9773
Fixes #5745
Closes #9775
This commit is contained in:
Daniel Stenberg 2022-10-20 15:21:12 +02:00
parent b15ca64bb0
commit 1e9a538e05
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
10 changed files with 424 additions and 93 deletions

View file

@ -119,7 +119,6 @@ problems may have been fixed or changed somewhat since this was written.
11.9 DoH does not inherit all transfer options
11.10 Blocking socket operations in non-blocking API
11.11 A shared connection cache is not thread-safe
11.12 'no_proxy' string-matches IPv6 numerical addresses
11.14 Multi perform hangs waiting for threaded resolver
11.15 CURLOPT_OPENSOCKETPAIRFUNCTION is missing
11.16 libcurl uses renames instead of locking for atomic operations
@ -931,13 +930,6 @@ problems may have been fixed or changed somewhat since this was written.
See https://github.com/curl/curl/issues/4915 and lib1541.c
11.12 'no_proxy' string-matches IPv6 numerical addresses
This has the downside that "::1" for example does not match "::0:1" even
though they are in fact the same address.
See https://github.com/curl/curl/issues/5745
11.14 Multi perform hangs waiting for threaded resolver
If a threaded resolver takes a long time to complete, libcurl can be blocked

View file

@ -53,10 +53,6 @@ brackets:
"example.com,::1,localhost"
IPv6 numerical addresses are compared as strings, so they will only match if
the representations are the same: "::1" is the same as "::0:1" but they do not
match.
The application does not have to keep the string around after setting this
option.
.SH "Environment variables"