]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Ospf ABR doesnt Advertise LSA summary 13019/head
authorrgirada <rgirada@vmware.com>
Fri, 17 Mar 2023 09:17:39 +0000 (09:17 +0000)
committerrgirada <rgirada@vmware.com>
Fri, 17 Mar 2023 10:11:28 +0000 (10:11 +0000)
Description:
OSPF ABR will summarise the networks based on configured range
and re-advtertise the summarised route. But if configured range
prefix id is same as one of the subset of routes prefix id then
as per rcf2328 Appendex-E recommendation, it will prepare the LSID and originate.
While re-advertising, it is using ospf LSDB instead of area specific
LSDB which is making it fail to re-advertise the summary lsa.
Fixed this by passing correct LSDB pointer.

Issue: #12995

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
ospfd/ospf_lsa.c

index 49e342d72b563fd663ac88632637f40924da9ee3..f41e303efb2b48cf0d5463088b20c6c7daa607a3 100644 (file)
@@ -38,7 +38,7 @@
 #include "ospfd/ospf_abr.h"
 #include "ospfd/ospf_errors.h"
 
-static struct ospf_lsa *ospf_handle_summarylsa_lsId_chg(struct ospf *ospf,
+static struct ospf_lsa *ospf_handle_summarylsa_lsId_chg(struct ospf_area *area,
                                                        struct prefix_ipv4 *p,
                                                        uint8_t type,
                                                        uint32_t metric,
@@ -1283,7 +1283,7 @@ ospf_summary_lsa_prepare_and_flood(struct prefix_ipv4 *p, uint32_t metric,
        return new;
 }
 
-static struct ospf_lsa *ospf_handle_summarylsa_lsId_chg(struct ospf *ospf,
+static struct ospf_lsa *ospf_handle_summarylsa_lsId_chg(struct ospf_area *area,
                                                        struct prefix_ipv4 *p,
                                                        uint8_t type,
                                                        uint32_t metric,
@@ -1293,13 +1293,14 @@ static struct ospf_lsa *ospf_handle_summarylsa_lsId_chg(struct ospf *ospf,
        struct ospf_lsa *new = NULL;
        struct summary_lsa *sl = NULL;
        struct ospf_area *old_area = NULL;
+       struct ospf *ospf = area->ospf;
        struct prefix_ipv4 old_prefix;
        uint32_t old_metric;
        struct in_addr mask;
        uint32_t metric_val;
        char *metric_buf;
 
-       lsa = ospf_lsdb_lookup_by_id(ospf->lsdb, type, p->prefix,
+       lsa = ospf_lsdb_lookup_by_id(area->lsdb, type, p->prefix,
                                     ospf->router_id);
 
        if (!lsa) {
@@ -1358,8 +1359,8 @@ struct ospf_lsa *ospf_summary_lsa_originate(struct prefix_ipv4 *p,
                if (IS_DEBUG_OSPF(lsa, LSA_GENERATE))
                        zlog_debug("Link ID has to be changed.");
 
-               new = ospf_handle_summarylsa_lsId_chg(
-                       area->ospf, p, OSPF_SUMMARY_LSA, metric, id);
+               new = ospf_handle_summarylsa_lsId_chg(area, p, OSPF_SUMMARY_LSA,
+                                                     metric, id);
                return new;
        } else if (status == LSID_NOT_AVAILABLE) {
                /* Link State ID not available. */
@@ -1521,7 +1522,7 @@ struct ospf_lsa *ospf_summary_asbr_lsa_originate(struct prefix_ipv4 *p,
                        zlog_debug("Link ID has to be changed.");
 
                new = ospf_handle_summarylsa_lsId_chg(
-                       area->ospf, p, OSPF_ASBR_SUMMARY_LSA, metric, id);
+                       area, p, OSPF_ASBR_SUMMARY_LSA, metric, id);
                return new;
        } else if (status == LSID_NOT_AVAILABLE) {
                /* Link State ID not available. */