Skip to content

Commit

Permalink
staticd: Formatting changes
Browse files Browse the repository at this point in the history
Warning fixes for indentation

Signed-off-by: VishalDhingra <vdhingra@vmware.com>
  • Loading branch information
vishaldhingra committed Jul 16, 2020
1 parent 314825f commit 7aa6f9c
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions staticd/static_routes.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,31 @@ int static_delete_nexthop(struct route_node *rn, struct static_path *pn,
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)
{
Expand All @@ -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);
}
}
}
Expand Down

0 comments on commit 7aa6f9c

Please sign in to comment.