]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: fix processing of SR RI LSAs
authorGalaxyGorilla <sascha@netdef.org>
Mon, 10 Aug 2020 10:25:16 +0000 (10:25 +0000)
committerGalaxyGorilla <sascha@netdef.org>
Mon, 10 Aug 2020 13:52:08 +0000 (13:52 +0000)
Router Information are contained in opaque LSAs and when such a LSA
is received a new SR node for the advertising router is created.

However, the RI related data is currently not set when such a SR node
already exists. This can happen when e.g. link and prefix information
arrive before the RI and therefore an SR node is created.

This is now fixed by setting the data everytime the RI is received,
independent of the SR node already existing or not.

Signed-off-by: GalaxyGorilla <sascha@netdef.org>
ospfd/ospf_sr.c

index 8110bc2d029ec37774a809c8fbba20255e3269a7..f2330d6bdd032807cd43cb422e0a4cb52a9414a4 100644 (file)
@@ -1048,32 +1048,25 @@ void ospf_sr_ri_lsa_update(struct ospf_lsa *lsa)
                }
                /* update LSA ID */
                srn->instance = ntohl(lsah->id.s_addr);
-               /* Copy SRGB */
-               srn->srgb.range_size = srgb.range_size;
-               srn->srgb.lower_bound = srgb.lower_bound;
-               /* Set Algorithm */
-               if (algo != NULL) {
-                       int i;
-                       for (i = 0; i < ntohs(algo->header.length); i++)
-                               srn->algo[i] = algo->value[0];
-                       for (; i < ALGORITHM_COUNT; i++)
-                               srn->algo[i] = SR_ALGORITHM_UNSET;
-               } else {
-                       srn->algo[0] = SR_ALGORITHM_SPF;
-               }
-               /* set MSD */
-               srn->msd = msd;
-               return;
        }
 
-       /* Check if SRGB has changed */
-       if ((srn->srgb.range_size == srgb.range_size)
-           && (srn->srgb.lower_bound == srgb.lower_bound))
-               return;
+       /* Set Algorithm */
+       if (algo != NULL) {
+               int i;
+               for (i = 0; i < ntohs(algo->header.length); i++)
+                       srn->algo[i] = algo->value[0];
+               for (; i < ALGORITHM_COUNT; i++)
+                       srn->algo[i] = SR_ALGORITHM_UNSET;
+       } else {
+               srn->algo[0] = SR_ALGORITHM_SPF;
+       }
 
-       /* Update SRGB ... */
+       srn->msd = msd;
+
+       /* Copy SRGB */
        srn->srgb.range_size = srgb.range_size;
        srn->srgb.lower_bound = srgb.lower_bound;
+
        /* ... and NHLFE if it is a neighbor SR node */
        if (srn->neighbor == OspfSR.self)
                hash_iterate(OspfSR.neighbors, update_out_nhlfe, srn);