summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-10-15 18:47:33 +0700
committerGitHub <noreply@github.com>2018-10-15 18:47:33 +0700
commitbccd615b3dada71b4e9b824f5e27738c22ee8585 (patch)
treef43f81c4a36de36a8e4e8f761379795e97e1cbd2
parentb6a22e51809ffaf6fe97f818051df34d9859a5ad (diff)
downloadipaddrcheck-revert-1-patch-1.tar.gz
ipaddrcheck-revert-1-patch-1.zip
Revert "T816 ipaddrcheck / libcidr but on IPv6 network validation"revert-1-patch-1
-rw-r--r--src/ipaddrcheck_functions.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ipaddrcheck_functions.c b/src/ipaddrcheck_functions.c
index 2ce7e52..82d01f9 100644
--- a/src/ipaddrcheck_functions.c
+++ b/src/ipaddrcheck_functions.c
@@ -101,7 +101,7 @@ int is_ipv6_cidr(char* address_str)
const char *error;
int erroffset;
- re = pcre_compile("^(((?:(?:(?:[A-F0-9]{1,4}:){6}|(?=(?:[A-F0-9]{0,4}:){0,6}(?:[0-9]{1,3}\.){3}[0-9]{1,3}$)(([0-9A-F]{1,4}:){0,5}|:)((:[0-9A-F]{1,4}){1,5}:|:)|::(?:[A-F0-9]{1,4}:){5})(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])|(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}|(?=(?:[A-F0-9]{0,4}:){0,7}[A-F0-9]{0,4}$)(([0-9A-F]{1,4}:){1,7}|:)((:[0-9A-F]{1,4}){1,7}|:)|(?:[A-F0-9]{1,4}:){7}:|:(:[A-F0-9]{1,4}){7}))(\\/\\d{1,3}))$",
+ re = pcre_compile("^((([0-9a-fA-F\\:])+)(\\/\\d{1,3}))$",
0, &error, &erroffset, NULL);
rc = pcre_exec(re, NULL, address_str, strlen(address_str), 0, 0, offsets, 1);
@@ -128,7 +128,7 @@ int is_ipv6_single(char* address_str)
const char *error;
int erroffset;
- re = pcre_compile("^(?:(?:(?:[A-F0-9]{1,4}:){6}|(?=(?:[A-F0-9]{0,4}:){0,6}(?:[0-9]{1,3}\.){3}[0-9]{1,3}$)(([0-9A-F]{1,4}:){0,5}|:)((:[0-9A-F]{1,4}){1,5}:|:)|::(?:[A-F0-9]{1,4}:){5})(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])|(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}|(?=(?:[A-F0-9]{0,4}:){0,7}[A-F0-9]{0,4}$)(([0-9A-F]{1,4}:){1,7}|:)((:[0-9A-F]{1,4}){1,7}|:)|(?:[A-F0-9]{1,4}:){7}:|:(:[A-F0-9]{1,4}){7})$",
+ re = pcre_compile("^(([0-9a-fA-F\\:])+)$",
0, &error, &erroffset, NULL);
rc = pcre_exec(re, NULL, address_str, strlen(address_str), 0, 0, offsets, 1);