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

@ -202,7 +202,7 @@ test1566 test1567 test1568 test1569 test1570 \
test1590 test1591 test1592 test1593 test1594 test1595 test1596 test1597 \
\
test1600 test1601 test1602 test1603 test1604 test1605 test1606 test1607 \
test1608 test1609 test1610 test1611 test1612 test1613 \
test1608 test1609 test1610 test1611 test1612 test1613 test1614 \
\
test1620 test1621 \
\

25
tests/data/test1614 Normal file
View file

@ -0,0 +1,25 @@
<testcase>
<info>
<keywords>
unittest
</keywords>
</info>
#
# Client-side
<client>
<server>
none
</server>
<features>
unittest
proxy
</features>
<name>
cidr comparisons
</name>
</client>
<errorcode>
0
</errorcode>
</testcase>