summaryrefslogtreecommitdiffstats
path: root/ripngd
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-09-17 02:51:11 +0200
committerRenato Westphal <renato@opensourcerouting.org>2019-09-18 19:35:10 +0200
commit8685be73e039dcb1b754e1fe21be96f60867219a (patch)
tree2f2bbd346162ed7672faefd0543211eec4c2ebd1 /ripngd
parentlib: introduce new 'pre_validate' northbound callback (diff)
downloadfrr-8685be73e039dcb1b754e1fe21be96f60867219a.tar.xz
frr-8685be73e039dcb1b754e1fe21be96f60867219a.zip
Revert "lib: introduce a read-write lock for northbound configurations"
Adding a lock to protect the global running configuration doesn't help much since the FRR daemons are not prepared to process configuration changes in a pthread that is not the main one (a whole lot of new protections would be necessary to prevent race conditions). This means the lock added by commit 83981138 only adds more complexity for no benefit. Remove it now to simplify the code. All northbound clients, including the gRPC one, should either run in the main pthread or use synchronization primitives to process configuration transactions in the main pthread. This reverts commit 83981138fe8c1e0a40b8dede74eca65449dda5de.
Diffstat (limited to 'ripngd')
-rw-r--r--ripngd/ripngd.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index 120f46f0d..ef4e47473 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -2795,18 +2795,14 @@ static int ripng_vrf_enable(struct vrf *vrf)
if (yang_module_find("frr-ripngd") && old_vrf_name) {
struct lyd_node *ripng_dnode;
- pthread_rwlock_wrlock(&running_config->lock);
- {
- ripng_dnode = yang_dnode_get(
- running_config->dnode,
- "/frr-ripngd:ripngd/instance[vrf='%s']/vrf",
- old_vrf_name);
- if (ripng_dnode) {
- yang_dnode_change_leaf(ripng_dnode, vrf->name);
- running_config->version++;
- }
+ ripng_dnode = yang_dnode_get(
+ running_config->dnode,
+ "/frr-ripngd:ripngd/instance[vrf='%s']/vrf",
+ old_vrf_name);
+ if (ripng_dnode) {
+ yang_dnode_change_leaf(ripng_dnode, vrf->name);
+ running_config->version++;
}
- pthread_rwlock_unlock(&running_config->lock);
}
if (old_vrf_name)
XFREE(MTYPE_RIPNG_VRF_NAME, old_vrf_name);