]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: remove one unnecessary parameter for evpn-mh
authoranlan_cs <vic.lan@pica8.com>
Wed, 13 Apr 2022 11:06:39 +0000 (07:06 -0400)
committeranlan_cs <vic.lan@pica8.com>
Mon, 9 May 2022 12:27:20 +0000 (08:27 -0400)
The "add" parameter of `bgp_evpn_mh_route_update()` makes no sense.
Just remove it to clarify this function, and remove the relevant check
with "add" as well.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
bgpd/bgp_evpn.c
bgpd/bgp_evpn_mh.c
bgpd/bgp_evpn_mh.h

index bfe7452fadb58f87b9d302d8ffc5889b049d7231..4229cec47eeb27eb02390008293944ea09d939d6 100644 (file)
@@ -3686,8 +3686,8 @@ static int update_advertise_vni_routes(struct bgp *bgp, struct bgpevpn *vpn)
 
                        es = bgp_evpn_es_find(&evp->prefix.ead_addr.esi);
                        bgp_evpn_mh_route_update(bgp, es, vpn, afi, safi,
-                                                global_dest, attr, 1,
-                                                &global_pi, &route_changed);
+                                                global_dest, attr, &global_pi,
+                                                &route_changed);
                }
 
                /* Schedule for processing and unlock node. */
index 39b31c0c1a7ce4665e25940b4e857ebe9a5a530c..6ce97d22c4e4e407c45e3fed114673edcca3e6b7 100644 (file)
@@ -351,7 +351,7 @@ static void bgp_evpn_es_route_del_all(struct bgp *bgp, struct bgp_evpn_es *es)
  */
 int bgp_evpn_mh_route_update(struct bgp *bgp, struct bgp_evpn_es *es,
                             struct bgpevpn *vpn, afi_t afi, safi_t safi,
-                            struct bgp_dest *dest, struct attr *attr, int add,
+                            struct bgp_dest *dest, struct attr *attr,
                             struct bgp_path_info **ri, int *route_changed)
 {
        struct bgp_path_info *tmp_pi = NULL;
@@ -390,9 +390,6 @@ int bgp_evpn_mh_route_update(struct bgp *bgp, struct bgp_evpn_es *es,
                return -1;
        }
 
-       if (!local_pi && !add)
-               return 0;
-
        /* create or update the entry */
        if (!local_pi) {
 
@@ -652,7 +649,7 @@ static int bgp_evpn_type4_route_update(struct bgp *bgp,
        dest = bgp_node_get(es->route_table, (struct prefix *)p);
 
        /* Create or update route entry. */
-       ret = bgp_evpn_mh_route_update(bgp, es, NULL, afi, safi, dest, &attr, 1,
+       ret = bgp_evpn_mh_route_update(bgp, es, NULL, afi, safi, dest, &attr,
                                       &pi, &route_changed);
        if (ret != 0)
                flog_err(
@@ -681,8 +678,7 @@ static int bgp_evpn_type4_route_update(struct bgp *bgp,
                dest = bgp_global_evpn_node_get(bgp->rib[afi][safi], afi, safi,
                                                p, &es->es_base_frag->prd);
                bgp_evpn_mh_route_update(bgp, es, NULL, afi, safi, dest,
-                                        attr_new, 1, &global_pi,
-                                        &route_changed);
+                                        attr_new, &global_pi, &route_changed);
 
                /* Schedule for processing and unlock node. */
                bgp_process(bgp, dest, afi, safi);
@@ -968,7 +964,7 @@ static int bgp_evpn_type1_route_update(struct bgp *bgp, struct bgp_evpn_es *es,
 
                /* Create or update route entry. */
                ret = bgp_evpn_mh_route_update(bgp, es, vpn, afi, safi, dest,
-                                              &attr, 1, &pi, &route_changed);
+                                              &attr, &pi, &route_changed);
                if (ret != 0)
                        flog_err(
                                EC_BGP_ES_INVALID,
@@ -990,7 +986,7 @@ static int bgp_evpn_type1_route_update(struct bgp *bgp, struct bgp_evpn_es *es,
 
                /* Create or update route entry. */
                ret = bgp_evpn_mh_route_update(bgp, es, vpn, afi, safi, dest,
-                                              &attr, 1, &pi, &route_changed);
+                                              &attr, &pi, &route_changed);
                if (ret != 0) {
                        flog_err(
                                EC_BGP_ES_INVALID,
@@ -1022,8 +1018,7 @@ static int bgp_evpn_type1_route_update(struct bgp *bgp, struct bgp_evpn_es *es,
                dest = bgp_global_evpn_node_get(bgp->rib[afi][safi], afi, safi,
                                                p, global_rd);
                bgp_evpn_mh_route_update(bgp, es, vpn, afi, safi, dest,
-                                        attr_new, 1, &global_pi,
-                                        &route_changed);
+                                        attr_new, &global_pi, &route_changed);
 
                /* Schedule for processing and unlock node. */
                bgp_process(bgp, dest, afi, safi);
index dc3fe44776d90fae447659eb69151ed73b27da92..11030e323fb1c6f8b43f1a9184b6903002398d77 100644 (file)
@@ -420,7 +420,7 @@ extern int delete_global_ead_evi_routes(struct bgp *bgp, struct bgpevpn *vpn);
 extern int bgp_evpn_mh_route_update(struct bgp *bgp, struct bgp_evpn_es *es,
                                    struct bgpevpn *vpn, afi_t afi, safi_t safi,
                                    struct bgp_dest *dest, struct attr *attr,
-                                   int add, struct bgp_path_info **ri,
+                                   struct bgp_path_info **ri,
                                    int *route_changed);
 int bgp_evpn_type1_route_process(struct peer *peer, afi_t afi, safi_t safi,
                struct attr *attr, uint8_t *pfx, int psize,