summaryrefslogtreecommitdiff
path: root/pbrd/pbr_main.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-09-11 10:43:49 -0300
committerRenato Westphal <renato@opensourcerouting.org>2020-09-11 14:42:35 -0300
commitf267201bf56852741cec89a05e13b75d14225143 (patch)
tree96cdca54983173206afc387a24b9cfd384aba2bf /pbrd/pbr_main.c
parenta77bd0f4e6b7d63e6f66288d7ea715ae8c55feee (diff)
lib: fix crashes with leafrefs that point to non-implemented modules
Whenever libyang loads a module that contains a leafref, it will also implicitly load the module of the referring node if it's not loaded already. That makes sense as otherwise it wouldn't be possible to validate the leafref value correctly. The problem is that loading a module implicitly violates the assumption of the northbound layer that all loaded modules are implemented (i.e. they have a northbound node associated to each schema node). This means that loading a module that isn't implemented can lead to crashes as the "priv" pointer of schema nodes is no longer guaranteed to be valid. To fix this problem, add a few null checks to ignore data nodes associated to non-implemented modules. The side effect of this change is harmless. If a daemon receives configuration it doesn't support (e.g. BFD peers on staticd), that configuration will be stored but otherwise ignored. This can only happen when using a northbound client like gRPC, as the CLI will never send to a daemon a command it doesn't support. This minor problem should go away in the long run as FRR migrates to a centralized management model, at which point the YANG-modeled configuration of all daemons will be maintained in a single place. Finally, update some daemons to stop implementing YANG modules they don't need to (i.e. revert 1b741a01c and a74b47f5). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'pbrd/pbr_main.c')
-rw-r--r--pbrd/pbr_main.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/pbrd/pbr_main.c b/pbrd/pbr_main.c
index 0711c66d4a..9a9edd79c6 100644
--- a/pbrd/pbr_main.c
+++ b/pbrd/pbr_main.c
@@ -117,7 +117,6 @@ struct quagga_signal_t pbr_signals[] = {
static const struct frr_yang_module_info *const pbrd_yang_modules[] = {
&frr_filter_info,
&frr_interface_info,
- &frr_vrf_info,
};
FRR_DAEMON_INFO(pbrd, PBR, .vty_port = PBR_VTY_PORT,