[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch] fix for crash
From: |
juris |
Subject: |
[patch] fix for crash |
Date: |
Wed, 12 Jun 2002 16:31:32 +0300 (GMT-3) |
I just looked in CVS, and this bug hasn't been fixed yet, and my ospfd
configurator crashed zebra yet again, so I thought I'll post this patch
again. Who knows, maybe it'll make it this time.
Basically, it fixes trivial error in list traversal, which causes
undefined behaviour when list items are removed.
--Juris
(Beware, this is against old CVS snapshot, but the fix is the same.)
--8<--------------------
--- zebra-cvs-prev/zebra/ospfd/ospfd.c Sun Oct 28 10:37:21 2001
+++ zebra-cvs/zebra/ospfd/ospfd.c Fri Feb 8 15:09:29 2002
@@ -575,7 +575,7 @@
ospf_if_update ()
{
struct route_node *rn;
- listnode node;
+ listnode node, node2;
struct ospf_network *network;
struct ospf_area *area;
@@ -591,12 +591,13 @@
}
/* find interfaces that not configured already */
- for (node = listhead (ospf_top->oiflist); node; nextnode (node))
+ for (node = listhead (ospf_top->oiflist); node; node = node2)
{
int found = 0;
struct ospf_interface *oi = getdata (node);
struct connected *co = oi->connected;
+ node2 = nextnode (node);
if (oi->type == OSPF_IFTYPE_VIRTUALLINK)
continue;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [patch] fix for crash,
juris <=