]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: External lsa handling in opaque capabilities enable/disable
authorrgirada <rgirada@vmware.com>
Sun, 25 Apr 2021 05:40:33 +0000 (22:40 -0700)
committermergify-bot <noreply@mergify.io>
Fri, 23 Jul 2021 09:10:37 +0000 (09:10 +0000)
Description:
When opaque capability disabled/enabled , all the self-originated lsa will be
flushed and it will make the neighbours to renegotiate.
But here, external lsas are not being re-originated after negotiation
Fix:
Refresh/re-originate external lsas(Type-5 and Type-7) explicitly after
re-negotiation.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
(cherry picked from commit a4d9009d47eec3df039938fc4cad6c0ffb8e9bf2)

ospfd/ospf_lsa.c
ospfd/ospf_neighbor.c

index 49829d86f1532efddc5946d5ffa80f28a6399cd1..c850df55bb5892a4799f601d5bd619810ed22a1b 100644 (file)
@@ -2084,6 +2084,8 @@ void ospf_external_lsa_rid_change(struct ospf *ospf)
 {
        struct external_info *ei;
        struct ospf_external_aggr_rt *aggr;
+       struct ospf_lsa *lsa = NULL;
+       int force;
        int type;
 
        for (type = 0; type < ZEBRA_ROUTE_MAX; type++) {
@@ -2112,24 +2114,48 @@ void ospf_external_lsa_rid_change(struct ospf *ospf)
                                        continue;
 
                                if (is_prefix_default(
-                                               (struct prefix_ipv4 *)&ei->p))
+                                           (struct prefix_ipv4 *)&ei->p))
                                        continue;
 
-                               if (!ospf_redistribute_check(ospf, ei, NULL))
-                                       continue;
+                               lsa = ospf_external_info_find_lsa(ospf, &ei->p);
 
                                aggr = ospf_external_aggr_match(ospf, &ei->p);
                                if (aggr) {
+
+                                       if (!ospf_redistribute_check(ospf, ei,
+                                                                    NULL))
+                                               continue;
+
                                        if (IS_DEBUG_OSPF(lsa, EXTNL_LSA_AGGR))
                                                zlog_debug(
                                                        "Originate Summary LSA after reset/router-ID change");
+
                                        /* Here the LSA is originated as new */
                                        ospf_originate_summary_lsa(ospf, aggr,
                                                                   ei);
-                               } else if (!ospf_external_lsa_originate(ospf,
-                                                                       ei))
-                                       flog_warn(EC_OSPF_LSA_INSTALL_FAILURE,
-                                                 "LSA: AS-external-LSA was not originated.");
+                               } else if (lsa) {
+                                       /* LSA needs to be refreshed even if
+                                        * there is no change in the route
+                                        * params if the LSA is in maxage.
+                                        */
+                                       if (IS_LSA_MAXAGE(lsa))
+                                               force = LSA_REFRESH_FORCE;
+                                       else
+                                               force = LSA_REFRESH_IF_CHANGED;
+
+                                       ospf_external_lsa_refresh(ospf, lsa,
+                                                               ei, force, 0);
+                               } else {
+                                       if (!ospf_redistribute_check(ospf, ei,
+                                                                    NULL))
+                                               continue;
+
+                                       if (!ospf_external_lsa_originate(ospf,
+                                                                        NULL))
+                                               flog_warn(
+                                                       EC_OSPF_LSA_INSTALL_FAILURE,
+                                                       "LSA: AS-external-LSA was not originated.");
+                               }
                        }
                }
        }
index a1b35b2fcd2bd912fc99fc16c3ef4d681373505f..8725497f2de9cd110cb8ba70667fc8fb79410f3e 100644 (file)
@@ -407,6 +407,9 @@ void ospf_renegotiate_optional_capabilities(struct ospf *top)
                }
        }
 
+       /* Refresh/Re-originate external LSAs (Type-7 and Type-5).*/
+       ospf_external_lsa_rid_change(top);
+
        return;
 }