pn = nb_running_get_entry(args->dnode, NULL, true);
rn = nb_running_get_entry(rn_dnode, NULL, true);
- if (!static_add_nexthop_validate(info->svrf, nh_type, &ipaddr))
+ if (!static_add_nexthop_validate(nh_vrf, nh_type, &ipaddr))
flog_warn(
EC_LIB_NB_CB_CONFIG_VALIDATE,
"Warning!! Local connected address is configured as Gateway IP((%s))",
vrf_reset_user_cfged(svrf->vrf);
}
-bool static_add_nexthop_validate(struct static_vrf *svrf, static_types type,
+bool static_add_nexthop_validate(const char *nh_vrf_name, static_types type,
struct ipaddr *ipaddr)
{
+ struct vrf *vrf;
+
+ vrf = vrf_lookup_by_name(nh_vrf_name);
+ if (!vrf)
+ return true;
+
switch (type) {
case STATIC_IPV4_GATEWAY:
case STATIC_IPV4_GATEWAY_IFNAME:
if (if_lookup_exact_address(&ipaddr->ipaddr_v4, AF_INET,
- svrf->vrf->vrf_id))
+ 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,
- svrf->vrf->vrf_id))
+ vrf->vrf_id))
return false;
break;
default:
safi_t safi, struct static_vrf *svrf);
extern void static_get_nh_type(static_types stype, char *type, size_t size);
-extern bool static_add_nexthop_validate(struct static_vrf *svrf,
+extern bool static_add_nexthop_validate(const char *nh_vrf_name,
static_types type,
struct ipaddr *ipaddr);
extern struct stable_info *static_get_stable_info(struct route_node *rn);