diff options
author | David Lamparter <equinox@diac24.net> | 2010-02-04 02:23:39 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2010-02-04 02:23:39 +0100 |
commit | 8f8f4dec2e41b217a0651a2f33112447ae04f73b (patch) | |
tree | f574a43c81c7cca6f00226abafa5422722ed7c61 /ospfd/ospf_flood.c | |
parent | 58bfa5562817306f14cd7d41953a2740056e1afc (diff) | |
parent | 43f93a5b3a491052b8206e6d94dd3c986aa9f45b (diff) | |
download | quagga-8f8f4dec2e41b217a0651a2f33112447ae04f73b.tar.bz2 quagga-8f8f4dec2e41b217a0651a2f33112447ae04f73b.tar.xz |
Merge branch 'patches/jt_ospf-fixes-20091129' into ospf-merge-3
Diffstat (limited to 'ospfd/ospf_flood.c')
-rw-r--r-- | ospfd/ospf_flood.c | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c index 41661da2..5ebf4f2f 100644 --- a/ospfd/ospf_flood.c +++ b/ospfd/ospf_flood.c @@ -346,7 +346,7 @@ ospf_flood_through_interface (struct ospf_interface *oi, struct ospf_lsa *lsa) { struct ospf_neighbor *onbr; - struct route_node *rn; + struct listnode *node; int retx_flag; if (IS_DEBUG_OSPF_EVENT) @@ -364,14 +364,10 @@ ospf_flood_through_interface (struct ospf_interface *oi, /* Each of the neighbors attached to this interface are examined, to determine whether they must receive the new LSA. The following steps are executed for each neighbor: */ - for (rn = route_top (oi->nbrs); rn; rn = route_next (rn)) + for (ALL_LIST_ELEMENTS_RO (oi->nbrs, node, onbr)) { struct ospf_lsa *ls_req; - - if (rn->info == NULL) - continue; - onbr = rn->info; if (IS_DEBUG_OSPF_EVENT) zlog_debug ("ospf_flood_through_interface(): considering nbr %s (%s)", inet_ntoa (onbr->router_id), @@ -543,13 +539,12 @@ ospf_flood_through_interface (struct ospf_interface *oi, addresses. */ if (oi->type == OSPF_IFTYPE_NBMA) { - struct route_node *rn; + struct listnode *node; struct ospf_neighbor *nbr; - for (rn = route_top (oi->nbrs); rn; rn = route_next (rn)) - if ((nbr = rn->info) != NULL) - if (nbr != oi->nbr_self && nbr->state >= NSM_Exchange) - ospf_ls_upd_send_lsa (nbr, lsa, OSPF_SEND_PACKET_DIRECT); + for (ALL_LIST_ELEMENTS_RO (oi->nbrs, node, nbr)) + if (nbr != oi->nbr_self && nbr->state >= NSM_Exchange) + ospf_ls_upd_send_lsa (nbr, lsa, OSPF_SEND_PACKET_DIRECT); } else ospf_ls_upd_send_lsa (oi->nbr_self, lsa, OSPF_SEND_PACKET_INDIRECT); @@ -934,21 +929,20 @@ static void ospf_ls_retransmit_delete_nbr_if (struct ospf_interface *oi, struct ospf_lsa *lsa) { - struct route_node *rn; + struct listnode *node; struct ospf_neighbor *nbr; struct ospf_lsa *lsr; if (ospf_if_is_enable (oi)) - for (rn = route_top (oi->nbrs); rn; rn = route_next (rn)) + for (ALL_LIST_ELEMENTS_RO (oi->nbrs, node, nbr)) /* If LSA find in LS-retransmit list, then remove it. */ - if ((nbr = rn->info) != NULL) - { - lsr = ospf_ls_retransmit_lookup (nbr, lsa); - - /* If LSA find in ls-retransmit list, remove it. */ - if (lsr != NULL && lsr->data->ls_seqnum == lsa->data->ls_seqnum) - ospf_ls_retransmit_delete (nbr, lsr); - } + { + lsr = ospf_ls_retransmit_lookup (nbr, lsa); + + /* If LSA find in ls-retransmit list, remove it. */ + if (lsr != NULL && lsr->data->ls_seqnum == lsa->data->ls_seqnum) + ospf_ls_retransmit_delete (nbr, lsr); + } } void |