summaryrefslogtreecommitdiffstats
path: root/bfdd
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-03-10 20:11:19 +0100
committerIgor Ryzhov <iryzhov@nfware.com>2021-03-14 22:44:08 +0100
commit59dad8137ef0466d15240b49ece8710b31e4784f (patch)
tree1bd4c2b5b093d884c6bfed4265ebadc7daebb82b /bfdd
parentMerge pull request #8244 from opensourcerouting/ci-fix-tests (diff)
downloadfrr-59dad8137ef0466d15240b49ece8710b31e4784f.tar.xz
frr-59dad8137ef0466d15240b49ece8710b31e4784f.zip
bfdd: make sessions administratively up by default
Current behavior is inconsistent. When the session is created by another daemon, it is up by default. When we later configure peer in bfdd, the session is still up, but the NB layer thinks that it is down. More than that, even when the session is created in bfdd using peer command, it is created in DOWN state, not ADM_DOWN. And it actually starts sending and receiving packets. The sessions is marked with SHUTDOWN flag only when we try to reconfigure some parameter. This behavior is also very unexpected. Fixes #7780. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'bfdd')
-rw-r--r--bfdd/bfd.c4
-rw-r--r--bfdd/bfdd_cli.c2
-rw-r--r--bfdd/bfdd_vty.c2
-rw-r--r--bfdd/ptm_adapter.c3
4 files changed, 4 insertions, 7 deletions
diff --git a/bfdd/bfd.c b/bfdd/bfd.c
index 499e54603..3cbb3691e 100644
--- a/bfdd/bfd.c
+++ b/bfdd/bfd.c
@@ -85,7 +85,7 @@ struct bfd_profile *bfd_profile_lookup(const char *name)
static void bfd_profile_set_default(struct bfd_profile *bp)
{
- bp->admin_shutdown = true;
+ bp->admin_shutdown = false;
bp->detection_multiplier = BFD_DEFDETECTMULT;
bp->echo_mode = false;
bp->passive = false;
@@ -206,7 +206,7 @@ void bfd_session_apply(struct bfd_session *bs)
bfd_set_passive_mode(bs, bs->peer_profile.passive);
/* Toggle 'no shutdown' if default value. */
- if (bs->peer_profile.admin_shutdown)
+ if (bs->peer_profile.admin_shutdown == false)
bfd_set_shutdown(bs, bp->admin_shutdown);
else
bfd_set_shutdown(bs, bs->peer_profile.admin_shutdown);
diff --git a/bfdd/bfdd_cli.c b/bfdd/bfdd_cli.c
index 5072c76aa..206f6c7d0 100644
--- a/bfdd/bfdd_cli.c
+++ b/bfdd/bfdd_cli.c
@@ -274,7 +274,7 @@ void bfd_cli_show_shutdown(struct vty *vty, struct lyd_node *dnode,
bool show_defaults)
{
if (show_defaults)
- vty_out(vty, " shutdown\n");
+ vty_out(vty, " no shutdown\n");
else
vty_out(vty, " %sshutdown\n",
yang_dnode_get_bool(dnode, NULL) ? "" : "no ");
diff --git a/bfdd/bfdd_vty.c b/bfdd/bfdd_vty.c
index 53e23cf6c..cb140f7b1 100644
--- a/bfdd/bfdd_vty.c
+++ b/bfdd/bfdd_vty.c
@@ -840,7 +840,7 @@ static int bfd_configure_peer(struct bfd_peer_cfg *bpc, bool mhop,
memset(bpc, 0, sizeof(*bpc));
/* Defaults */
- bpc->bpc_shutdown = true;
+ bpc->bpc_shutdown = false;
bpc->bpc_detectmultiplier = BPC_DEF_DETECTMULTIPLIER;
bpc->bpc_recvinterval = BPC_DEF_RECEIVEINTERVAL;
bpc->bpc_txinterval = BPC_DEF_TRANSMITINTERVAL;
diff --git a/bfdd/ptm_adapter.c b/bfdd/ptm_adapter.c
index 0c70600f2..4135e5fb4 100644
--- a/bfdd/ptm_adapter.c
+++ b/bfdd/ptm_adapter.c
@@ -492,9 +492,6 @@ static void bfdd_dest_register(struct stream *msg, vrf_id_t vrf_id)
"ptm-add-dest: failed to create BFD session");
return;
}
-
- /* Protocol created peers are 'no shutdown' by default. */
- bs->peer_profile.admin_shutdown = false;
} else {
/*
* BFD session was already created, we are just updating the