From: David Lamparter Date: Thu, 19 Jul 2012 14:11:50 +0000 (+0200) Subject: lib: make IPv6 prefix parser slightly more strict X-Git-Tag: frr-2.0-rc1~1792 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=aa5cf24b9de96245f2166ef1c4e9612890ced1b3;p=matthieu%2Ffrr.git 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 Signed-off-by: David Lamparter --- diff --git a/lib/command.c b/lib/command.c index 4d95e924d7..64563b5d02 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; }