summaryrefslogtreecommitdiff
path: root/resolv/tst-inet_pton.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-06-23 22:51:00 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-06-23 22:51:06 +0200
commit9a0cc8c1bd7645bf3c988890ffb59639c07a5812 (patch)
tree8de136777f54b60d406e5fcd5f64889c2e5949ea /resolv/tst-inet_pton.c
parentfa872e1b6210e81e60d6029429f0a083b8eab26e (diff)
inet_pton: Reject IPv6 addresses with many leading zeros [BZ #16637]
2001:db8:00001::f is not a valid IPv6 address according to RFC 2373.
Diffstat (limited to 'resolv/tst-inet_pton.c')
-rw-r--r--resolv/tst-inet_pton.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/resolv/tst-inet_pton.c b/resolv/tst-inet_pton.c
index 7fffb24cdf..4bb9f81193 100644
--- a/resolv/tst-inet_pton.c
+++ b/resolv/tst-inet_pton.c
@@ -226,13 +226,7 @@ const struct test_case test_cases[] =
},
{.input = "2", },
{.input = "2.", },
- {.input = "2001:db8:00001::f",
- .ipv6_ok = true,
- .ipv6_expected = {
- 0x20, 0x1, 0xd, 0xb8, 0x0, 0x1, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xf
- },
- },
+ {.input = "2001:db8:00001::f", },
{.input = "2001:db8:10000::f", },
{.input = "2001:db8:1234:5678:abcd:ef01:2345:67",
.ipv6_ok = true,
@@ -454,13 +448,7 @@ const struct test_case test_cases[] =
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
},
},
- {.input = "::00001",
- .ipv6_ok = true,
- .ipv6_expected = {
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1
- },
- },
+ {.input = "::00001", },
{.input = "::1",
.ipv6_ok = true,
.ipv6_expected = {