summaryrefslogtreecommitdiffstats
path: root/lib/command.c
diff options
context:
space:
mode:
authorhasso <hasso>2003-05-25 21:04:54 +0000
committerhasso <hasso>2003-05-25 21:04:54 +0000
commit9d13049bc83142fca99d70c7e8d60ff956202d3f (patch)
treebc74a2753d0e2457d2ba0629de9ab6041182d432 /lib/command.c
parent42bebb8a3742319ba5eef482a2a823b3728fca4c (diff)
downloadquagga-9d13049bc83142fca99d70c7e8d60ff956202d3f.tar.bz2
quagga-9d13049bc83142fca99d70c7e8d60ff956202d3f.tar.xz
Last fixes from 6Wind patch.
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/command.c b/lib/command.c
index f57cf5ca..5d429338 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -718,6 +718,8 @@ cmd_ipv6_match (char *str)
int state = STATE_START;
int colons = 0, nums = 0, double_colon = 0;
char *sp = NULL;
+ struct sockaddr_in6 sin6_dummy;
+ int ret;
if (str == NULL)
return partly_match;
@@ -725,6 +727,15 @@ cmd_ipv6_match (char *str)
if (strspn (str, IPV6_ADDR_STR) != strlen (str))
return no_match;
+ /* use inet_pton that has a better support,
+ * for example inet_pton can support the automatic addresses:
+ * ::1.2.3.4
+ */
+ ret = inet_pton(AF_INET6, str, &sin6_dummy.sin6_addr);
+
+ if (ret == 1)
+ return exact_match;
+
while (*str != '\0')
{
switch (state)