]> git.puffer.fish Git - mirror/frr.git/commitdiff
bfdd: make sessions administratively up by default 8231/head
authorIgor Ryzhov <iryzhov@nfware.com>
Wed, 10 Mar 2021 19:11:19 +0000 (22:11 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Sun, 14 Mar 2021 21:44:08 +0000 (00:44 +0300)
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>
bfdd/bfd.c
bfdd/bfdd_cli.c
bfdd/bfdd_vty.c
bfdd/ptm_adapter.c
yang/frr-bfdd.yang

index 499e54603f47bc48108a15df731fccbe63fad7b0..3cbb3691ec47f434b3d64bc653842fc3145c5421 100644 (file)
@@ -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);
index 5072c76aac1919c234dbd84b0c6cc6edf1217b30..206f6c7d0c1d64eb9f7dc4ed01b6c7e004816e46 100644 (file)
@@ -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 ");
index 53e23cf6c2139d2c072c659456ef72c1a002d2cd..cb140f7b1833c781c719af5dadeb35ac7dd656b1 100644 (file)
@@ -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;
index 0c70600f20015ec8b0ca3b4ed778794928554e80..4135e5fb493d2d6301872ad00d4ac87e11523ccc 100644 (file)
@@ -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
index 5b434162d0fd739d43efe52d08dbcde768d4f957..0f090a1b7217b39cefa7bb65720c23815d727496 100644 (file)
@@ -185,7 +185,7 @@ module frr-bfdd {
 
     leaf administrative-down {
       type boolean;
-      default true;
+      default false;
       description "Disables or enables the session administratively";
     }