]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: cleanup bgp_damp_info_free
authorIgor Ryzhov <iryzhov@nfware.com>
Wed, 28 Jul 2021 22:39:38 +0000 (01:39 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 29 Jul 2021 21:59:19 +0000 (00:59 +0300)
bgp_damp_config, afi and safi are never used.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
bgpd/bgp_damp.c
bgpd/bgp_damp.h
bgpd/bgp_route.c

index f2090279c92cdc000dd43e02f9db6ce65cd653ca..6d2dc1a65a54a8193c81fd2bebbebf0cb4e9bcb8 100644 (file)
@@ -228,8 +228,7 @@ static int bgp_reuse_timer(struct thread *t)
 
                        if (bdi->penalty <= bdc->reuse_limit / 2.0) {
                                bgp_reuselist_del(&plist, bdi);
-                               bgp_damp_info_free(bdi, bdc, 1, bdi->afi,
-                                                  bdi->safi);
+                               bgp_damp_info_free(bdi, 1);
                        } else {
                                bdi->index = BGP_DAMP_NO_REUSE_LIST_INDEX;
                                bgp_reuselist_switch(&plist, bdi,
@@ -379,16 +378,15 @@ int bgp_damp_update(struct bgp_path_info *path, struct bgp_dest *dest,
                bdi->t_updated = t_now;
        else {
                bgp_damp_info_unclaim(bdi);
-               bgp_damp_info_free(bdi, bdc, 0, afi, safi);
+               bgp_damp_info_free(bdi, 0);
        }
 
        return status;
 }
 
-void bgp_damp_info_free(struct bgp_damp_info *bdi, struct bgp_damp_config *bdc,
-                       int withdraw, afi_t afi, safi_t safi)
+void bgp_damp_info_free(struct bgp_damp_info *bdi, int withdraw)
 {
-       assert(bdc && bdi);
+       assert(bdi);
 
        bdi->path->extra->damp_info = NULL;
        bgp_path_info_unset_flag(bdi->dest, bdi->path,
@@ -508,13 +506,13 @@ void bgp_damp_info_clean(struct bgp *bgp, struct bgp_damp_config *bdc,
                                            bdi->safi);
                        }
                        bgp_reuselist_del(list, bdi);
-                       bgp_damp_info_free(bdi, bdc, 1, afi, safi);
+                       bgp_damp_info_free(bdi, 1);
                }
        }
 
        while ((bdi = SLIST_FIRST(&bdc->no_reuse_list)) != NULL) {
                bgp_reuselist_del(&bdc->no_reuse_list, bdi);
-               bgp_damp_info_free(bdi, bdc, 1, afi, safi);
+               bgp_damp_info_free(bdi, 1);
        }
 
        /* Free decay array */
index 2e41d2fbdaa05b754bfe56d7cc858b36b525e535..fc03b97c13bcf3dc5ad9d1446fbcc96aabbaeb2a 100644 (file)
@@ -145,9 +145,7 @@ extern int bgp_damp_withdraw(struct bgp_path_info *path, struct bgp_dest *dest,
                             afi_t afi, safi_t safi, int attr_change);
 extern int bgp_damp_update(struct bgp_path_info *path, struct bgp_dest *dest,
                           afi_t afi, safi_t saff);
-extern void bgp_damp_info_free(struct bgp_damp_info *bdi,
-                              struct bgp_damp_config *bdc, int withdraw,
-                              afi_t afi, safi_t safi);
+extern void bgp_damp_info_free(struct bgp_damp_info *bdi, int withdraw);
 extern void bgp_damp_info_clean(struct bgp *bgp, struct bgp_damp_config *bdc,
                                afi_t afi, safi_t safi);
 extern void bgp_damp_config_clean(struct bgp_damp_config *bdc);
index f39386f7dd44966f18a96a528f8a76f18ce200c5..08e643ccdc0058f502bd04b268b7c7249cdbac67 100644 (file)
@@ -14759,8 +14759,7 @@ static int bgp_clear_damp_route(struct vty *vty, const char *view_name,
                                                pi_temp = pi->next;
                                                bgp_damp_info_free(
                                                        pi->extra->damp_info,
-                                                       &bgp->damp[afi][safi],
-                                                       1, afi, safi);
+                                                       1);
                                                pi = pi_temp;
                                        } else
                                                pi = pi->next;
@@ -14797,8 +14796,7 @@ static int bgp_clear_damp_route(struct vty *vty, const char *view_name,
                                                }
                                                bgp_damp_info_free(
                                                        pi->extra->damp_info,
-                                                       &bgp->damp[afi][safi],
-                                                       1, afi, safi);
+                                                       1);
                                                pi = pi_temp;
                                        } else
                                                pi = pi->next;