We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ef15e8 commit ccef5d7Copy full SHA for ccef5d7
src/test/netbase_tests.cpp
@@ -160,6 +160,9 @@ BOOST_AUTO_TEST_CASE(subnet_test)
160
BOOST_CHECK(ResolveSubNet("1.2.2.20/26").Match(ResolveIP("1.2.2.63")));
161
// All-Matching IPv6 Matches arbitrary IPv4 and IPv6
162
BOOST_CHECK(ResolveSubNet("::/0").Match(ResolveIP("1:2:3:4:5:6:7:1234")));
163
+ // But not `::` or `0.0.0.0` because they are considered invalid addresses
164
+ BOOST_CHECK(!ResolveSubNet("::/0").Match(ResolveIP("::")));
165
+ BOOST_CHECK(!ResolveSubNet("::/0").Match(ResolveIP("0.0.0.0")));
166
BOOST_CHECK(ResolveSubNet("::/0").Match(ResolveIP("1.2.3.4")));
167
// All-Matching IPv4 does not Match IPv6
168
BOOST_CHECK(!ResolveSubNet("0.0.0.0/0").Match(ResolveIP("1:2:3:4:5:6:7:1234")));
0 commit comments