]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
OSPF: Fix bogus LSA ID collisions between received and originated LSAs
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 22 Mar 2016 11:51:31 +0000 (12:51 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 23 Mar 2016 01:21:42 +0000 (02:21 +0100)
After restart, LSAs locally originated by the previous instance are
received from neighbors. They are installed to LSA db and flushed. If
export of a route triggers origination of a new external LSA before flush
of the received one is complete, the check in ospf_originate_lsa() causes
origination to fail (because en->nf is NULL for the old LSA and non-NULL
for the new LSA). The patch fixes this by updating the en->nf for LSAs
being flushed (as is already done for empty ones). Generally, en->nf
field deserves some better description in the code.

Thanks to Jigar Mehta for analyzing the problem.

proto/ospf/topology.c

index 8119cfa6db49d51a9b76fee580a13c85d5d7f597..7558d4a00070910d84f5091dcd2a2b41b10fb700 100644 (file)
@@ -278,7 +278,7 @@ ospf_originate_lsa(struct ospf_proto *p, struct ospf_new_lsa *lsa)
   if (!SNODE_VALID(en))
     s_add_tail(&p->lsal, SNODE en);
 
-  if (en->lsa_body == NULL)
+  if (!en->nf || !en->lsa_body)
     en->nf = lsa->nf;
 
   if (en->nf != lsa->nf)