]> git.puffer.fish Git - mirror/frr.git/commit
lib: Fix nondeterministic command matches in rare cases
authorQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 15 Nov 2016 22:15:18 +0000 (22:15 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 15 Nov 2016 22:15:18 +0000 (22:15 +0000)
commit3c7ca60c410fe87dc10ab5a26049b89e15dada78
tree49bbc13ccc7b35544c8f0c8a93f5dd660769edd5
parentfefa0d82145890019b5cf66bc2e2323f603f6d79
lib: Fix nondeterministic command matches in rare cases

When a user erroneously defines two commands which can
match the same input and at least one of the tokens defined
last in the command is a selector or option, the matcher
does not detect an ambiguous match and matches the command
installed first (leftmost in the graph).

Fix is to do a full walkthrough of the follow set when
matching the final token in a command to check that there
is exactly one possible match, and to throw an ambiguity
error otherwise.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/command_match.c