]> git.puffer.fish Git - matthieu/frr.git/commit
lib: fix "reduce strcmp in CLI" fallout (10bac801)
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 12 May 2015 15:18:04 +0000 (17:18 +0200)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 8 Jun 2016 18:58:36 +0000 (14:58 -0400)
commit27e7f290292b7789d750758e5feea18ee6ca2a14
tree1119ef9c290f321b1aaccccad5635fff95238dd6
parent6b87f736187d1a40a6b4f8d4fe42716bac09e857
lib: fix "reduce strcmp in CLI" fallout (10bac801)

In "lib/cli: reduce strcmp in CLI hot paths", I failed to notice that
CMD_VARIABLE as a boolean test covers a superset of the other types of
variables.  Thus, the patch broke processing of IP/IPv6/Integer range
parameters in the CLI.

Fix by some reordering and introducing TERMINAL_RECORD macro (which
marks whether a given terminal type is a parameter) to be used in places
where the check is really for all kinds of variables.

Reported-by: Timo Teräs <timo.teras@iki.fi>
Tested-by: Martin Winter <mwinter@netdef.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/command.c
lib/command.h