summaryrefslogtreecommitdiffstats
path: root/bfdd/bfdd_vty.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2019-04-17 18:01:11 +0200
committerPhilippe Guibert <philippe.guibert@6wind.com>2019-04-18 11:48:16 +0200
commit6bdb4a42acda17c2127032acc3495a1e7af4b13f (patch)
tree2dfffa28da5c2a1d383bb7efb17eb652679ea1b6 /bfdd/bfdd_vty.c
parent.gitignore: ignore core dumps (diff)
downloadfrr-6bdb4a42acda17c2127032acc3495a1e7af4b13f.tar.xz
frr-6bdb4a42acda17c2127032acc3495a1e7af4b13f.zip
bfdd: avoid having bfd config inherited from operation context
there are cases where bfd sessions are created from remote daemons. in that case, the bfd daemon were appearing in both operational and configuration contexts of bfd. Change that by only keeping operational contexts. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bfdd/bfdd_vty.c')
-rw-r--r--bfdd/bfdd_vty.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/bfdd/bfdd_vty.c b/bfdd/bfdd_vty.c
index c13949207..4efdd817c 100644
--- a/bfdd/bfdd_vty.c
+++ b/bfdd/bfdd_vty.c
@@ -158,6 +158,12 @@ DEFUN_NOSH(
}
}
+ if (!BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_CONFIG)) {
+ if (bs->refcount)
+ vty_out(vty, "%% session peer is now configurable via bfd daemon.\n");
+ BFD_SET_FLAG(bs->flags, BFD_SESS_FLAG_CONFIG);
+ }
+
VTY_PUSH_CONTEXT(BFD_PEER_NODE, bs);
return CMD_SUCCESS;
@@ -984,6 +990,9 @@ static void _bfdd_peer_write_config_iter(struct hash_bucket *hb, void *arg)
struct vty *vty = arg;
struct bfd_session *bs = hb->data;
+ if (!BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_CONFIG))
+ return;
+
_bfdd_peer_write_config(vty, bs);
}