]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: make IPv6 prefix parser slightly more strict
authorDavid Lamparter <equinox@opensourcerouting.org>
Thu, 19 Jul 2012 14:11:50 +0000 (16:11 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Thu, 19 Jul 2012 14:15:50 +0000 (16:15 +0200)
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>
lib/command.c

index 4d95e924d73f4685555cb5d25e0e48b3e1e2acf0..64563b5d0265debddd87bb77cb178bbc3b4b5f34 100644 (file)
@@ -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;
            }