diff options
Diffstat (limited to 'staticd')
| -rw-r--r-- | staticd/static_routes.c | 16 | ||||
| -rw-r--r-- | staticd/static_vrf.c | 11 | ||||
| -rw-r--r-- | staticd/static_vrf.h | 1 | ||||
| -rw-r--r-- | staticd/static_zebra.c | 14 |
4 files changed, 10 insertions, 32 deletions
diff --git a/staticd/static_routes.c b/staticd/static_routes.c index 60f384e517..1d52dd30e2 100644 --- a/staticd/static_routes.c +++ b/staticd/static_routes.c @@ -199,14 +199,14 @@ bool static_add_nexthop_validate(const char *nh_vrf_name, switch (type) { case STATIC_IPV4_GATEWAY: case STATIC_IPV4_GATEWAY_IFNAME: - if (if_lookup_exact_address(&ipaddr->ipaddr_v4, AF_INET, - vrf->vrf_id)) + if (if_address_is_local(&ipaddr->ipaddr_v4, AF_INET, + vrf->vrf_id)) return false; break; case STATIC_IPV6_GATEWAY: case STATIC_IPV6_GATEWAY_IFNAME: - if (if_lookup_exact_address(&ipaddr->ipaddr_v6, AF_INET6, - vrf->vrf_id)) + if (if_address_is_local(&ipaddr->ipaddr_v6, AF_INET6, + vrf->vrf_id)) return false; break; default: @@ -432,13 +432,13 @@ static void static_ifindex_update_nh(struct interface *ifp, bool up, if (up) { if (strcmp(nh->ifname, ifp->name)) return; - if (nh->nh_vrf_id != ifp->vrf_id) + if (nh->nh_vrf_id != ifp->vrf->vrf_id) return; nh->ifindex = ifp->ifindex; } else { if (nh->ifindex != ifp->ifindex) return; - if (nh->nh_vrf_id != ifp->vrf_id) + if (nh->nh_vrf_id != ifp->vrf->vrf_id) return; nh->ifindex = IFINDEX_INTERNAL; } @@ -723,7 +723,7 @@ static void static_fixup_intf_nh(struct route_table *stable, continue; frr_each(static_path_list, &si->path_list, pn) { frr_each(static_nexthop_list, &pn->nexthop_list, nh) { - if (nh->nh_vrf_id != ifp->vrf_id) + if (nh->nh_vrf_id != ifp->vrf->vrf_id) continue; if (nh->ifindex != ifp->ifindex) @@ -750,7 +750,7 @@ void static_install_intf_nh(struct interface *ifp) struct static_vrf *svrf = vrf->info; /* Not needed if same vrf since happens naturally */ - if (vrf->vrf_id == ifp->vrf_id) + if (vrf->vrf_id == ifp->vrf->vrf_id) continue; /* Install any static routes configured for this interface. */ diff --git a/staticd/static_vrf.c b/staticd/static_vrf.c index 4bea3075c9..6ba0bf4544 100644 --- a/staticd/static_vrf.c +++ b/staticd/static_vrf.c @@ -123,17 +123,6 @@ struct route_table *static_vrf_static_table(afi_t afi, safi_t safi, return svrf->stable[afi][safi]; } -struct static_vrf *static_vrf_lookup_by_id(vrf_id_t vrf_id) -{ - struct vrf *vrf; - - vrf = vrf_lookup_by_id(vrf_id); - if (vrf) - return ((struct static_vrf *)vrf->info); - - return NULL; -} - struct static_vrf *static_vrf_lookup_by_name(const char *name) { struct vrf *vrf; diff --git a/staticd/static_vrf.h b/staticd/static_vrf.h index be311af8c4..885246bfaa 100644 --- a/staticd/static_vrf.h +++ b/staticd/static_vrf.h @@ -39,7 +39,6 @@ struct stable_info { #define GET_STABLE_VRF_ID(info) info->svrf->vrf->vrf_id struct static_vrf *static_vrf_lookup_by_name(const char *vrf_name); -struct static_vrf *static_vrf_lookup_by_id(vrf_id_t vrf_id); void static_vrf_init(void); diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c index 538fae28aa..311aeda338 100644 --- a/staticd/static_zebra.c +++ b/staticd/static_zebra.c @@ -84,12 +84,6 @@ static int interface_address_delete(ZAPI_CALLBACK_ARGS) static int static_ifp_up(struct interface *ifp) { - if (if_is_vrf(ifp)) { - struct static_vrf *svrf = static_vrf_lookup_by_id(ifp->vrf_id); - - static_fixup_vrf_ids(svrf); - } - /* Install any static reliant on this interface coming up */ static_install_intf_nh(ifp); static_ifindex_update(ifp, true); @@ -162,14 +156,10 @@ static bool static_nexthop_is_local(vrf_id_t vrfid, struct prefix *addr, int family) { if (family == AF_INET) { - if (if_lookup_exact_address(&addr->u.prefix4, - AF_INET, - vrfid)) + if (if_address_is_local(&addr->u.prefix4, AF_INET, vrfid)) return true; } else if (family == AF_INET6) { - if (if_lookup_exact_address(&addr->u.prefix6, - AF_INET6, - vrfid)) + if (if_address_is_local(&addr->u.prefix6, AF_INET6, vrfid)) return true; } return false; |
