]> git.proxmox.com Git - mirror_frr.git/commit - lib/command_match.c
lib: fix rare bug in ambiguous command resolution
authorQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 25 Aug 2017 17:39:13 +0000 (13:39 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 25 Aug 2017 19:41:27 +0000 (15:41 -0400)
commit8295b504cbd6df715b779287ff9d2374ae306421
tree6040542906d943e1b2a8ab04c17266fe11378683
parente1bd637370df9708af91c699b2510a788625bc5a
lib: fix rare bug in ambiguous command resolution

In certain situations, the CLI matcher would not handle ambiguous
commands properly. If it found an ambiguous result in a lower subgraph,
the ambiguous result would not correctly propagate up to previous frames
in the resolution DFS as ambiguous; instead it would propagate up as a
non-match, which could subsequently be overridden by a partial match.

Example CLI space:

  show ip route summary
  show ip route supernet-only
  show ipv6 route summary

Entering `show ip route su` would result in an ambiguous resolution for
the `show ip route` subgraph but would propagate up to the `show ip`
subgraph as a no-match, allowing `ip` to partial-match `ipv6` and
execute that command.

In this example entering `show ip route summary` would disambiguate the
`show ip` subgraph. So this bug would only appear when entering input
that caused ambiguities in at least two parallel subgraphs.

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