]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
OSPF: Fix infinite loop in OSPF Graceful Restart
authorOndrej Zajicek <santiago@crfreenet.org>
Mon, 4 May 2026 23:15:32 +0000 (01:15 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Mon, 4 May 2026 23:15:32 +0000 (01:15 +0200)
The loop tests 'j' but increments 'i', so 'j' never changes
and the loop never terminates.

proto/ospf/rt.c

index d7753ce0aa16d9ae3cd4b9753fd559ab858d867e..99b45c300320d4d11c672b9bcfe660b2e7ec8c24 100644 (file)
@@ -2226,7 +2226,7 @@ ospf_update_gr_recovery(struct ospf_proto *p)
          /* Find all neighbors from the network-LSA */
          struct ospf_lsa_net *net_body = net->lsa_body;
          uint cnt = lsa_net_count(&net->lsa);
-         for (j = 0; j < cnt; i++)
+         for (j = 0; j < cnt; j++)
          {
            n = find_neigh(ifa, net_body->routers[j]);
            if (!n || (n->state != NEIGHBOR_FULL))