summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2021-02-10 22:06:36 +0700
committerDaniil Baturin <daniil@baturin.org>2021-02-10 22:06:36 +0700
commit3eb5e4a458ec62bcf14d065d47d9827327a51b2a (patch)
treed519feff694062f92dc49d1b5547ae27c0e150bc
parenta5eb1c40b58f653d902572d9deb21919df103544 (diff)
downloadipaddrcheck-3eb5e4a458ec62bcf14d065d47d9827327a51b2a.tar.gz
ipaddrcheck-3eb5e4a458ec62bcf14d065d47d9827327a51b2a.zip
Correct the double colon check commands.
How late at night must it have been for me to write "semicolons"?
-rw-r--r--src/ipaddrcheck.c5
-rw-r--r--src/ipaddrcheck_functions.c4
-rw-r--r--src/ipaddrcheck_functions.h2
3 files changed, 5 insertions, 6 deletions
diff --git a/src/ipaddrcheck.c b/src/ipaddrcheck.c
index 2bfc8c9..92250d8 100644
--- a/src/ipaddrcheck.c
+++ b/src/ipaddrcheck.c
@@ -258,15 +258,14 @@ int main(int argc, char* argv[])
return(EXIT_FAILURE);
}
- /* FIXUP: libcidr allows more than one double semicolon, but the RFC does not! */
- if( duplicate_double_semicolons(address_str) ) {
+ /* FIXUP: libcidr allows more than one double colon, but RFC 4291 does not! */
+ if( duplicate_double_colons(address_str) ) {
if( verbose )
{
printf("More than one \"::\" is not allowed in IPv6 addresses\n");
}
return(EXIT_FAILURE);
}
- /* no else needed, the rest is one big else */
while( (action_count >= 0) && (result == RESULT_SUCCESS) )
{
diff --git a/src/ipaddrcheck_functions.c b/src/ipaddrcheck_functions.c
index 965ee19..d98ceda 100644
--- a/src/ipaddrcheck_functions.c
+++ b/src/ipaddrcheck_functions.c
@@ -37,8 +37,8 @@
*/
-/* Does it contain double semicolons? This is not allowed in IPv6 addresses */
-int duplicate_double_semicolons(char* address_str) {
+/* Does it contain double colons? This is not allowed in IPv6 addresses */
+int duplicate_double_colons(char* address_str) {
int offsets[1];
pcre *re;
int rc;
diff --git a/src/ipaddrcheck_functions.h b/src/ipaddrcheck_functions.h
index 07fa776..73dd246 100644
--- a/src/ipaddrcheck_functions.h
+++ b/src/ipaddrcheck_functions.h
@@ -52,7 +52,7 @@
#define NO_LOOPBACK 0
#define LOOPBACK_ALLOWED 1
-int duplicate_double_semicolons(char* address_str);
+int duplicate_double_colons(char* address_str);
int is_ipv4_cidr(char* address_str);
int is_ipv4_single(char* address_str);
int is_ipv6_cidr(char* address_str);