summaryrefslogtreecommitdiffstats
path: root/staticd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-06-29 17:09:01 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-07-29 18:43:23 +0200
commit0b70cb101c6fea5dd79396219ecb38dc13035b1e (patch)
tree4493e5502088cd75287f7ffd026a2db296dd1f41 /staticd
parentstaticd: Allow daemon to have backup static routes (diff)
downloadfrr-0b70cb101c6fea5dd79396219ecb38dc13035b1e.tar.xz
frr-0b70cb101c6fea5dd79396219ecb38dc13035b1e.zip
staticd: Fix crash with NULL si
Move the call to the static_install_route to inside of the loop, since we have changed the behavior of how we send down routes to zebra a bit. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'staticd')
-rw-r--r--staticd/static_routes.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/staticd/static_routes.c b/staticd/static_routes.c
index 9f4338f94..ef0e6d057 100644
--- a/staticd/static_routes.c
+++ b/staticd/static_routes.c
@@ -296,9 +296,9 @@ static void static_ifindex_update_af(struct interface *ifp, bool up, afi_t afi,
continue;
si->ifindex = IFINDEX_INTERNAL;
}
- }
- static_install_route(rn, si, safi);
+ static_install_route(rn, si, safi);
+ }
}
}
}
@@ -321,16 +321,13 @@ static void static_fixup_vrf(struct static_vrf *svrf,
struct route_node *rn;
struct static_route *si;
struct interface *ifp;
- bool install;
for (rn = route_top(stable); rn; rn = route_next(rn)) {
- install = false;
for (si = rn->info; si; si = si->next) {
if (strcmp(svrf->vrf->name, si->nh_vrfname) != 0)
continue;
si->nh_vrf_id = svrf->vrf->vrf_id;
- install = true;
if (si->ifindex) {
ifp = if_lookup_by_name(si->ifname,
si->nh_vrf_id);
@@ -339,10 +336,9 @@ static void static_fixup_vrf(struct static_vrf *svrf,
else
continue;
}
- }
- if (install)
static_install_route(rn, si, safi);
+ }
}
}
@@ -363,10 +359,8 @@ static void static_enable_vrf(struct static_vrf *svrf,
struct static_route *si;
struct interface *ifp;
struct vrf *vrf = svrf->vrf;
- bool install;
for (rn = route_top(stable); rn; rn = route_next(rn)) {
- install = false;
for (si = rn->info; si; si = si->next) {
si->vrf_id = vrf->vrf_id;
if (si->ifindex) {
@@ -377,11 +371,8 @@ static void static_enable_vrf(struct static_vrf *svrf,
else
continue;
}
- install = true;
- }
-
- if (install)
static_install_route(rn, si, safi);
+ }
}
}