]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bfdd: remove redundant nb destroy callbacks
authorIgor Ryzhov <iryzhov@nfware.com>
Wed, 31 May 2023 12:28:08 +0000 (15:28 +0300)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 8 Jun 2023 15:20:16 +0000 (15:20 +0000)
Fixes warning logs:
```
2023/05/29 20:11:50 BFD: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-bfdd:bfdd/bfd/profile/minimum-ttl'
2023/05/29 20:11:50 BFD: [ZKB8W-3S2Q4][EC 100663330] unneeded 'destroy' callback for '/frr-bfdd:bfdd/bfd/sessions/multi-hop/minimum-ttl'
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
(cherry picked from commit f7884aedf7a1249e3aae71b6a66c9a0f0915c4ef)

bfdd/bfdd_nb.c
bfdd/bfdd_nb.h
bfdd/bfdd_nb_config.c

index 29a9b5f2d527028c2da07fded678e49ecc2ea21f..a819516ec872d0fd9fcbb5f382090f54b1246c4f 100644 (file)
@@ -88,7 +88,6 @@ const struct frr_yang_module_info frr_bfdd_info = {
                        .xpath = "/frr-bfdd:bfdd/bfd/profile/minimum-ttl",
                        .cbs = {
                                .modify = bfdd_bfd_profile_minimum_ttl_modify,
-                               .destroy = bfdd_bfd_profile_minimum_ttl_destroy,
                                .cli_show = bfd_cli_show_minimum_ttl,
                        }
                },
@@ -375,7 +374,6 @@ const struct frr_yang_module_info frr_bfdd_info = {
                        .xpath = "/frr-bfdd:bfdd/bfd/sessions/multi-hop/minimum-ttl",
                        .cbs = {
                                .modify = bfdd_bfd_sessions_multi_hop_minimum_ttl_modify,
-                               .destroy = bfdd_bfd_sessions_multi_hop_minimum_ttl_destroy,
                                .cli_show = bfd_cli_show_minimum_ttl,
                        }
                },
index d7ac320638e71355ea94f44d50f7882615b6480e..072a4a93e04ec99734ff41047a14ab4ca953cc21 100644 (file)
@@ -39,7 +39,6 @@ int bfdd_bfd_profile_required_receive_interval_modify(
 int bfdd_bfd_profile_administrative_down_modify(struct nb_cb_modify_args *args);
 int bfdd_bfd_profile_passive_mode_modify(struct nb_cb_modify_args *args);
 int bfdd_bfd_profile_minimum_ttl_modify(struct nb_cb_modify_args *args);
-int bfdd_bfd_profile_minimum_ttl_destroy(struct nb_cb_destroy_args *args);
 int bfdd_bfd_profile_echo_mode_modify(struct nb_cb_modify_args *args);
 int bfdd_bfd_profile_desired_echo_transmission_interval_modify(
        struct nb_cb_modify_args *args);
@@ -142,8 +141,6 @@ int bfdd_bfd_sessions_multi_hop_administrative_down_modify(
        struct nb_cb_modify_args *args);
 int bfdd_bfd_sessions_multi_hop_minimum_ttl_modify(
        struct nb_cb_modify_args *args);
-int bfdd_bfd_sessions_multi_hop_minimum_ttl_destroy(
-       struct nb_cb_destroy_args *args);
 struct yang_data *
 bfdd_bfd_sessions_multi_hop_stats_local_discriminator_get_elem(
        struct nb_cb_get_elem_args *args);
index c1a2ad7bb43e065b921426a3820305e9d2f2c400..cc74d584acbdcc327f29c9750c6a8f06fe3de00b 100644 (file)
@@ -437,20 +437,6 @@ int bfdd_bfd_profile_minimum_ttl_modify(struct nb_cb_modify_args *args)
        return NB_OK;
 }
 
-int bfdd_bfd_profile_minimum_ttl_destroy(struct nb_cb_destroy_args *args)
-{
-       struct bfd_profile *bp;
-
-       if (args->event != NB_EV_APPLY)
-               return NB_OK;
-
-       bp = nb_running_get_entry(args->dnode, NULL, true);
-       bp->minimum_ttl = BFD_DEF_MHOP_TTL;
-       bfd_profile_update(bp);
-
-       return NB_OK;
-}
-
 /*
  * XPath: /frr-bfdd:bfdd/bfd/profile/echo-mode
  */
@@ -873,27 +859,3 @@ int bfdd_bfd_sessions_multi_hop_minimum_ttl_modify(
 
        return NB_OK;
 }
-
-int bfdd_bfd_sessions_multi_hop_minimum_ttl_destroy(
-       struct nb_cb_destroy_args *args)
-{
-       struct bfd_session *bs;
-
-       switch (args->event) {
-       case NB_EV_VALIDATE:
-       case NB_EV_PREPARE:
-               return NB_OK;
-
-       case NB_EV_APPLY:
-               break;
-
-       case NB_EV_ABORT:
-               return NB_OK;
-       }
-
-       bs = nb_running_get_entry(args->dnode, NULL, true);
-       bs->peer_profile.minimum_ttl = BFD_DEF_MHOP_TTL;
-       bfd_session_apply(bs);
-
-       return NB_OK;
-}