bgpd: Variable reuse in bgpd/bgpd.c
In bgp_delete(), variables 'node' and 'next' are overwritten in
the nested for loop.
Signed-off-by: Denil Vira <denil@cumulusnetworks.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 7a0274c..4b69313 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -2098,8 +2098,8 @@
{
struct peer *peer;
struct peer_group *group;
- struct listnode *node;
- struct listnode *next;
+ struct listnode *node, *pnode;
+ struct listnode *next, *pnext;
afi_t afi;
int i;
@@ -2127,7 +2127,7 @@
for (ALL_LIST_ELEMENTS (bgp->group, node, next, group))
{
- for (ALL_LIST_ELEMENTS (group->peer, node, next, peer))
+ for (ALL_LIST_ELEMENTS (group->peer, pnode, pnext, peer))
{
if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->status))
{