summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuan Yuan <yyuanam@amazon.com>2021-09-29 19:36:28 +0000
committerYuan Yuan <yyuanam@amazon.com>2021-09-29 19:37:33 +0000
commita1638c7ce504f263dd7b9d779ad9560ae192383a (patch)
tree6540af158ec0b1652cb920c22f031c6a9e79bf3d
parenta8a5b215148a1b5857085e4318a6e9af876453df (diff)
ospfd: Fix assert related to capability opaque
The capability opaque command can trigger asserts through a rather round-about mechanism. The command eventually calls ospf_renegotiate_optional_capabilities, which will call ospf_flush_self_originated_lsas_now, which has the side effect of marking the OSPF instance as shutting down. This was causing the flooding logic to call ospf_write immediately insted of waiting for the select IO loop every time it was sending a maxage LSA. This could cause the list of OSPF interfaces needing to send packets to be drained while there was a call to ospf_write pending from the IO loop. When the pending call ran, it would see the empty list of interfaces and assert. Signed-off-by: Yuan Yuan <yyuanam@amazon.com>
-rw-r--r--ospfd/ospf_neighbor.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ospfd/ospf_neighbor.c b/ospfd/ospf_neighbor.c
index 98fb54d82a..c59734b9f3 100644
--- a/ospfd/ospf_neighbor.c
+++ b/ospfd/ospf_neighbor.c
@@ -382,10 +382,17 @@ void ospf_renegotiate_optional_capabilities(struct ospf *top)
struct route_table *nbrs;
struct route_node *rn;
struct ospf_neighbor *nbr;
+ uint8_t shutdown_save = top->inst_shutdown;
/* At first, flush self-originated LSAs from routing domain. */
ospf_flush_self_originated_lsas_now(top);
+ /* ospf_flush_self_originated_lsas_now is primarily intended for shut
+ * down scenarios. Reset the inst_shutdown flag that it sets. We are
+ * just changing configuration, and the flag can change the scheduling
+ * of when maxage LSAs are sent. */
+ top->inst_shutdown = shutdown_save;
+
/* Revert all neighbor status to ExStart. */
for (ALL_LIST_ELEMENTS_RO(top->oiflist, node, oi)) {
if ((nbrs = oi->nbrs) == NULL)