summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDiogo Sousa <diogogsousa@gmail.com>2013-06-16 20:16:58 +0100
committerDiogo Sousa <diogogsousa@gmail.com>2013-06-16 20:16:58 +0100
commite4b6f4b375f292ceb2e8b6c338a746937f058ae5 (patch)
tree153647ca419e8ca502f9096750d6f37a4f4ee481
parent32dee82c584776e4a5a1cbefb195ae6d0a8fe752 (diff)
Refined IPv6 address matching in url.c.
-rw-r--r--src/common/url.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/url.c b/src/common/url.c
index b57f9fc3..3d38083c 100644
--- a/src/common/url.c
+++ b/src/common/url.c
@@ -350,7 +350,9 @@ do_an_re(const char *word,int *start, int *end, int *type)
 #define DOMAIN "[a-z0-9][-a-z0-9]*(\\.[-a-z0-9]+)*\\."
 #define TLD "[a-z][-a-z0-9]*[a-z]"
 #define IPADDR "[0-9]{1,3}(\\.[0-9]{1,3}){3}"
-#define IPV6ADDR "([0-9a-f]{0,4}(:[0-9a-f]{0,4})*:){2}[0-9a-f]{0,4}(:[0-9a-f]{0,4})*"
+#define IPV6GROUP "([0-9a-f]{0,4})"
+#define IPV6ADDR "((" IPV6GROUP "(:" IPV6GROUP "){7})"	\
+	         "|(" IPV6GROUP "(:" IPV6GROUP ")*:(:" IPV6GROUP ")+))" /* with :: compression */
 #define HOST "(" DOMAIN TLD "|" IPADDR "|" IPV6ADDR ")"
 #define OPT_PORT "(:[1-9][0-9]{0,4})?"