summaryrefslogtreecommitdiffstats
path: root/staticd
diff options
context:
space:
mode:
authorvdhingra <vdhingra@vmware.com>2020-07-12 19:59:26 +0200
committervdhingra <vdhingra@vmware.com>2020-07-16 18:56:23 +0200
commit7aa6f9cd47e8574bb4932c88063850e49ca8b665 (patch)
treeca7c8a6b69f5a9d92a8f35a85e3c97c9154e0931 /staticd
parentstaticd: Added afi-safi as a key in route-list (diff)
downloadfrr-7aa6f9cd47e8574bb4932c88063850e49ca8b665.tar.xz
frr-7aa6f9cd47e8574bb4932c88063850e49ca8b665.zip
staticd: Formatting changes
Warning fixes for indentation Signed-off-by: VishalDhingra <vdhingra@vmware.com>
Diffstat (limited to 'staticd')
-rw-r--r--staticd/static_routes.c48
1 files changed, 28 insertions, 20 deletions
diff --git a/staticd/static_routes.c b/staticd/static_routes.c
index 829fe6cd6..3836109e3 100644
--- a/staticd/static_routes.c
+++ b/staticd/static_routes.c
@@ -358,6 +358,31 @@ EXIT:
return 1;
}
+static void static_ifindex_update_nh(struct interface *ifp, bool up,
+ struct route_node *rn,
+ struct static_path *pn,
+ struct static_nexthop *nh,
+ struct static_vrf *svrf, safi_t safi)
+{
+ if (!nh->ifname[0])
+ return;
+ if (up) {
+ if (strcmp(nh->ifname, ifp->name))
+ return;
+ if (nh->nh_vrf_id != ifp->vrf_id)
+ return;
+ nh->ifindex = ifp->ifindex;
+ } else {
+ if (nh->ifindex != ifp->ifindex)
+ return;
+ if (nh->nh_vrf_id != ifp->vrf_id)
+ return;
+ nh->ifindex = IFINDEX_INTERNAL;
+ }
+
+ static_install_path(rn, pn, safi, svrf);
+}
+
static void static_ifindex_update_af(struct interface *ifp, bool up, afi_t afi,
safi_t safi)
{
@@ -383,26 +408,9 @@ static void static_ifindex_update_af(struct interface *ifp, bool up, afi_t afi,
frr_each(static_path_list, &si->path_list, pn) {
frr_each(static_nexthop_list,
&pn->nexthop_list, nh) {
- if (!nh->ifname[0])
- continue;
- if (up) {
- if (strcmp(nh->ifname,
- ifp->name))
- continue;
- if (nh->nh_vrf_id
- != ifp->vrf_id)
- continue;
- nh->ifindex = ifp->ifindex;
- } else {
- if (nh->ifindex != ifp->ifindex)
- continue;
- if (nh->nh_vrf_id
- != ifp->vrf_id)
- continue;
- nh->ifindex = IFINDEX_INTERNAL;
- }
-
- static_install_path(rn, pn, safi, svrf);
+ static_ifindex_update_nh(ifp, up, rn,
+ pn, nh, svrf,
+ safi);
}
}
}