diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2020-11-14 18:50:37 -0500 | 
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2020-11-14 18:53:03 -0500 | 
| commit | f18ba3cd18210fceac80fc1bf21fcb116d4d4397 (patch) | |
| tree | 7ec928e01f625f4114d3c522e6168b9518e8302f /bgpd/bgp_addpath.c | |
| parent | 3d1c148b07c7c81e98fd3059100bd84ba92c4546 (diff) | |
bgpd, lib, staticd, tests: Convert to using FOREACH_AFI_SAFI
Move the FOREACH_AFI_SAFI macro from bgpd.h to zebra.h( GLOBAL's YOUALL )
Then convert all the places that have the two level for loop to
iterate over all afi/safis
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'bgpd/bgp_addpath.c')
| -rw-r--r-- | bgpd/bgp_addpath.c | 12 | 
1 files changed, 5 insertions, 7 deletions
diff --git a/bgpd/bgp_addpath.c b/bgpd/bgp_addpath.c index d07d41bef8..d822f6e330 100644 --- a/bgpd/bgp_addpath.c +++ b/bgpd/bgp_addpath.c @@ -80,14 +80,12 @@ void bgp_addpath_init_bgp_data(struct bgp_addpath_bgp_data *d)  	afi_t afi;  	int i; -	for (afi = AFI_IP; afi < AFI_MAX; afi++) { -		for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) { -			for (i = 0; i < BGP_ADDPATH_MAX; i++) { -				d->id_allocators[afi][safi][i] = NULL; -				d->peercount[afi][safi][i] = 0; -			} -			d->total_peercount[afi][safi] = 0; +	FOREACH_AFI_SAFI (afi, safi) { +		for (i = 0; i < BGP_ADDPATH_MAX; i++) { +			d->id_allocators[afi][safi][i] = NULL; +			d->peercount[afi][safi][i] = 0;  		} +		d->total_peercount[afi][safi] = 0;  	}  }  | 
