diff options
author | GalaxyGorilla <sascha@netdef.org> | 2020-08-10 12:25:16 +0200 |
---|---|---|
committer | GalaxyGorilla <sascha@netdef.org> | 2020-08-10 15:52:08 +0200 |
commit | 29df0fc749931650770866f5c358187dffe5060b (patch) | |
tree | 8b8c4d5ec7c955dca515cd0db9947db9ab6e5e7e /ospfd/ospf_sr.c | |
parent | Merge pull request #6877 from opensourcerouting/misc-docstring-fix (diff) | |
download | frr-29df0fc749931650770866f5c358187dffe5060b.tar.xz frr-29df0fc749931650770866f5c358187dffe5060b.zip |
ospfd: fix processing of SR RI LSAs
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>
Diffstat (limited to 'ospfd/ospf_sr.c')
-rw-r--r-- | ospfd/ospf_sr.c | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/ospfd/ospf_sr.c b/ospfd/ospf_sr.c index 8110bc2d0..f2330d6bd 100644 --- a/ospfd/ospf_sr.c +++ b/ospfd/ospf_sr.c @@ -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); |