summaryrefslogtreecommitdiff
path: root/staticd/static_routes.c
diff options
context:
space:
mode:
Diffstat (limited to 'staticd/static_routes.c')
-rw-r--r--staticd/static_routes.c51
1 files changed, 21 insertions, 30 deletions
diff --git a/staticd/static_routes.c b/staticd/static_routes.c
index d105b2123f..05355c48fe 100644
--- a/staticd/static_routes.c
+++ b/staticd/static_routes.c
@@ -35,7 +35,7 @@
#include "static_zebra.h"
#include "static_debug.h"
-DEFINE_MTYPE_STATIC(STATIC, STATIC_ROUTE, "Static Route Info");
+DEFINE_MTYPE(STATIC, STATIC_ROUTE, "Static Route Info");
DEFINE_MTYPE(STATIC, STATIC_PATH, "Static Path");
/* Install static path into rib. */
@@ -546,19 +546,15 @@ void static_fixup_vrf_ids(struct static_vrf *enable_svrf)
svrf = vrf->info;
/* Install any static routes configured for this VRF. */
- for (afi = AFI_IP; afi < AFI_MAX; afi++) {
- for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) {
- stable = svrf->stable[afi][safi];
- if (!stable)
- continue;
+ FOREACH_AFI_SAFI (afi, safi) {
+ stable = svrf->stable[afi][safi];
+ if (!stable)
+ continue;
- static_fixup_vrf(enable_svrf, stable,
- afi, safi);
+ static_fixup_vrf(enable_svrf, stable, afi, safi);
- if (enable_svrf == svrf)
- static_enable_vrf(svrf, stable,
- afi, safi);
- }
+ if (enable_svrf == svrf)
+ static_enable_vrf(svrf, stable, afi, safi);
}
}
}
@@ -649,20 +645,17 @@ void static_cleanup_vrf_ids(struct static_vrf *disable_svrf)
svrf = vrf->info;
/* Uninstall any static routes configured for this VRF. */
- for (afi = AFI_IP; afi < AFI_MAX; afi++) {
- for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) {
- struct route_table *stable;
+ FOREACH_AFI_SAFI (afi, safi) {
+ struct route_table *stable;
- stable = svrf->stable[afi][safi];
- if (!stable)
- continue;
+ stable = svrf->stable[afi][safi];
+ if (!stable)
+ continue;
- static_cleanup_vrf(disable_svrf, stable,
- afi, safi);
+ static_cleanup_vrf(disable_svrf, stable, afi, safi);
- if (disable_svrf == svrf)
- static_disable_vrf(stable, afi, safi);
- }
+ if (disable_svrf == svrf)
+ static_disable_vrf(stable, afi, safi);
}
}
}
@@ -725,14 +718,12 @@ void static_install_intf_nh(struct interface *ifp)
continue;
/* Install any static routes configured for this interface. */
- for (afi = AFI_IP; afi < AFI_MAX; afi++) {
- for (safi = SAFI_UNICAST; safi < SAFI_MAX; safi++) {
- stable = svrf->stable[afi][safi];
- if (!stable)
- continue;
+ FOREACH_AFI_SAFI (afi, safi) {
+ stable = svrf->stable[afi][safi];
+ if (!stable)
+ continue;
- static_fixup_intf_nh(stable, ifp, afi, safi);
- }
+ static_fixup_intf_nh(stable, ifp, afi, safi);
}
}
}