ipmask_parse: Reject a full IPv6 address followed by ::.
[ircu2.10.12-pk.git] / ircd / test / ircd_in_addr_t.c
index 07f6cc96abe9f479be4bfc97e014922a5e7b71d5..381460789508a7cb0911744a1b4b571ca9efae7e 100644 (file)
@@ -29,7 +29,7 @@ static struct address_test test_addrs[] = {
       {{ 0, 0, 0, 0, 0, 0, 0, 1 }},
       "AAAAAA", "_AAB", 1, 0, 1 },
     { "127.0.0.1", "127.0.0.1",
-      {{ 0, 0, 0, 0, 0, 0, 0x7f00, 1 }},
+      {{ 0, 0, 0, 0, 0, 0xffff, 0x7f00, 1 }},
       "B]AAAB", "B]AAAB", 1, 1, 1 },
     { "::ffff:127.0.0.3", "127.0.0.3",
       {{ 0, 0, 0, 0, 0, 0xffff, 0x7f00, 3 }},
@@ -111,6 +111,7 @@ static struct ipmask_test test_masks[] = {
     { "::10.0.0.0", {{ 0, 0, 0, 0, 0, 0, 0xa00, 0 }}, 1, 1, 128 },
     { "192.168/16", {{ 0, 0, 0, 0, 0, 0xffff, 0xc0a8, 0 }}, 1, 1, 112 },
     { "192.*", {{ 0, 0, 0, 0, 0, 0xffff, 0xc000, 0 }}, 1, 1, 104 },
+    { "192.*.*.*", {{ 0, 0, 0, 0, 0, 0xffff, 0xc000, 0 }}, 1, 1, 104 },
     { "192.*/8", {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 1, 0, 0 },
     { "192*", {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 1, 0, 0 },
     { "192.168.0.0/16", {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 0, 0, 0 },
@@ -120,7 +121,13 @@ static struct ipmask_test test_masks[] = {
     { "a:b", {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 1, 0, 0 },
     { "a::*", {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 1, 0, 0 },
     { "a:*", {{ 0xa, 0, 0, 0, 0, 0, 0, 0 }}, 1, 1, 16 },
+    { "a:*:*", {{ 0xa, 0, 0, 0, 0, 0, 0, 0 }}, 1, 1, 16 },
     { "a:/16", {{ 0xa, 0, 0, 0, 0, 0, 0, 0 }}, 1, 1, 16 },
+    { "0.0.0.0.0/1", {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 0, 0, 0 },
+    { "2607:3f00:1:30c:9999*",
+      {{ 0x2607, 0x3f00, 1, 0x30c, 0x9999, 0, 0, 0 }}, 1, 1, 80 },
+    { "1234:5678:9abc:def0:feed:abba:cabb:1e55::",
+      {{ 0, 0, 0, 0, 0, 0, 0, 0 }}, 1, 0, 0 },
     { 0 }
 };