]> 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)
committerIgor Ryzhov <iryzhov@nfware.com>
Wed, 31 May 2023 12:28:08 +0000 (15:28 +0300)
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>
bfdd/bfdd_nb.c
bfdd/bfdd_nb.h
bfdd/bfdd_nb_config.c

index 7135c507638a282922070122c0e06c0e1e886273..114fbc2bdd8759161d561ac5e02e770c7b37f975 100644 (file)
@@ -74,7 +74,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,
                        }
                },
@@ -361,7 +360,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 7a0e724d28e24542268fc964e3c17cc640dc56a5..b5b00b57e4b04127e58bea8c3a328e64ab433a48 100644 (file)
@@ -25,7 +25,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);
@@ -128,8 +127,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 e4e97404d8b9cc8140a951de5ceb2aa7a2cd3b9b..8cf2f0a6f12c9c7fefb0317c0b182b83bcbc75a6 100644 (file)
@@ -423,20 +423,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
  */
@@ -859,27 +845,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;
-}