]> git.proxmox.com Git - mirror_frr.git/commit
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>
Tue, 9 Jul 2019 14:09:05 +0000 (11:09 -0300)
commite7ba083cbed36bd14285acda73e7e67e7e35a196
tree8cf2e6b1a1fb233b58df6445ffd290149382b418
parent070154df33f61549889f00de3aa3a297f359a337
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