]> git.proxmox.com Git - mirror_frr.git/commit - lib/vty.c
lib: fix outdated candidate configuration issue
authorRenato Westphal <renato@opensourcerouting.org>
Mon, 27 May 2019 22:48:13 +0000 (19:48 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 12 Jun 2019 14:17:03 +0000 (11:17 -0300)
commiteaf6705d7a9fdcfd48c8fb51fc4fe7cffd7701f2
treed07d16528c109b8268384e4709e2228a5a12d5da
parentafbdfbb69bcf1d50cc07e59e91829866d766618f
lib: fix outdated candidate configuration issue

Even when using the classic CLI mode (i.e. when --tcli is not
used), the northbound code still uses vty->candidate_config
to perform configuration changes. From the perspective of the
user, the running configuration is being edited directly, but
under the hood the northbound layer does a full configuration
transaction for each command.  When the running configuration is
edited by a northbound client other than the CLI (e.g. kernel,
gRPC), vty->candidate_config might become outdated, and this can
lead to lots of weird problems. To fix this, always regenerate
vty->candidate_config before each configuration command when
using the classic CLI mode. When using the transactional CLI,
the user needs to update the candidate manually using the "update"
command, otherwise the "commit" command will fail with this error:
"% Candidate configuration needs to be updated before commit".

Fixes some problems reported by Don after moving an interface from
one VRF to another one while zebra is running.

Reported-by: Don Slice <dslice@cumulusnetworks.com>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
lib/command.c
lib/vty.c