summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2012-07-19 16:11:50 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2012-07-19 16:15:50 +0200
commitaa5cf24b9de96245f2166ef1c4e9612890ced1b3 (patch)
treefc8a8895286c635764e2d409b7ab6567a5b9ee6f /lib
parentee1ac2d52a6656e589ca2fb4feb3ec5fd366ecb7 (diff)
lib: make IPv6 prefix parser slightly more strict
This makes it possible to have both "show babel route A.B.C.D/M" and "show babel route X:X::X:X/M" commands at the same time without the parser complaining about ambiguity. * lib/command.c: only accept STATE_DOT after : was seen. Reported-by: Juliusz Chroboczek <jch@pps.jussieu.fr> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/command.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/command.c b/lib/command.c
index 4d95e924..64563b5d 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -954,7 +954,12 @@ cmd_ipv6_prefix_match (const char *str)
if (*(str + 1) == ':')
state = STATE_COLON;
else if (*(str + 1) == '.')
- state = STATE_DOT;
+ {
+ if (colons || double_colon)
+ state = STATE_DOT;
+ else
+ return no_match;
+ }
else if (*(str + 1) == '/')
state = STATE_SLASH;
}