summaryrefslogtreecommitdiff
path: root/bgpd/bgp_routemap.c
diff options
context:
space:
mode:
authorpaul <paul>2005-04-07 07:30:20 +0000
committerpaul <paul>2005-04-07 07:30:20 +0000
commit1eb8ef2584833f18fb674e127d59cb5a7f771482 (patch)
treef5b09d4781de9a9b08839fefb6530e64d2d2ec31 /bgpd/bgp_routemap.c
parent5920990fecba7e2430af3cfaa8bcbaed40d0ba1a (diff)
2005-04-07 Paul Jakma <paul.jakma@sun.com>
* (global): Fix up list loops to match changes in lib/linklist, and some basic auditing of usage. * configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES * HACKING: Add notes about deprecating interfaces and commands. * lib/linklist.h: Add usage comments. Rename getdata macro to listgetdata. Rename nextnode to listnextnode and fix its odd behaviour to be less dangerous. Make listgetdata macro assert node is not null, NULL list entries should be bug condition. ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use with for loop, Suggested by Jim Carlson of Sun. Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the "safety" of previous macro. LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to distinguish from the similarly named functions, and reflect their effect better. Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section with the old defines which were modified above, for backwards compatibility - guarded to prevent Quagga using it.. * lib/linklist.c: fix up for linklist.h changes. * ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single scan of the area list, rather than scanning all areas first for INTER_ROUTER and then again for INTER_NETWORK. According to 16.2, the scan should be area specific anyway, and further ospf6d does not seem to implement 16.3 anyway.
Diffstat (limited to 'bgpd/bgp_routemap.c')
-rw-r--r--bgpd/bgp_routemap.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index b11aaf23..060c68c0 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -108,7 +108,7 @@ route_match_peer (void *rule, struct prefix *prefix, route_map_object_t type,
union sockunion *su2;
struct peer_group *group;
struct peer *peer;
- struct listnode *nn;
+ struct listnode *node, *nnode;
if (type == RMAP_BGP)
{
@@ -147,7 +147,7 @@ route_match_peer (void *rule, struct prefix *prefix, route_map_object_t type,
else
{
group = peer->group;
- LIST_LOOP (group->peer, peer, nn)
+ for (ALL_LIST_ELEMENTS (group->peer, node, nnode, peer))
{
if (sockunion_same (su, &peer->su))
return RMAP_MATCH;
@@ -2181,7 +2181,8 @@ bgp_route_map_update (const char *unused)
afi_t afi;
safi_t safi;
int direct;
- struct listnode *nn, *nm;
+ struct listnode *node, *nnode;
+ struct listnode *mnode, *mnnode;
struct bgp *bgp;
struct peer *peer;
struct peer_group *group;
@@ -2190,9 +2191,9 @@ bgp_route_map_update (const char *unused)
struct bgp_static *bgp_static;
/* For neighbor route-map updates. */
- LIST_LOOP (bm->bgp, bgp, nn)
+ for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp))
{
- LIST_LOOP (bgp->peer, peer, nm)
+ for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
@@ -2214,7 +2215,7 @@ bgp_route_map_update (const char *unused)
filter->usmap.map = NULL;
}
}
- LIST_LOOP (bgp->group, group, nm)
+ for (ALL_LIST_ELEMENTS (bgp->group, node, nnode, group))
{
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
@@ -2239,9 +2240,9 @@ bgp_route_map_update (const char *unused)
}
/* For default-originate route-map updates. */
- LIST_LOOP (bm->bgp, bgp, nn)
+ for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp))
{
- LIST_LOOP (bgp->peer, peer, nm)
+ for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer))
{
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
@@ -2256,7 +2257,7 @@ bgp_route_map_update (const char *unused)
}
/* For network route-map updates. */
- LIST_LOOP (bm->bgp, bgp, nn)
+ for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp))
{
for (afi = AFI_IP; afi < AFI_MAX; afi++)
for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++)
@@ -2273,7 +2274,7 @@ bgp_route_map_update (const char *unused)
}
/* For redistribute route-map updates. */
- LIST_LOOP (bm->bgp, bgp, nn)
+ for (ALL_LIST_ELEMENTS (bm->bgp, mnode, mnnode, bgp))
{
for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
{