summaryrefslogtreecommitdiff
path: root/staticd/static_nb_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'staticd/static_nb_config.c')
-rw-r--r--staticd/static_nb_config.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/staticd/static_nb_config.c b/staticd/static_nb_config.c
index 5f5f7a1976..ede2e38754 100644
--- a/staticd/static_nb_config.c
+++ b/staticd/static_nb_config.c
@@ -474,6 +474,13 @@ static int static_nexthop_bh_type_modify(struct nb_cb_modify_args *args)
nh_vrf = yang_dnode_get_string(args->dnode, "../vrf");
if (nh_ifname && nh_vrf) {
struct vrf *vrf = vrf_lookup_by_name(nh_vrf);
+
+ if (!vrf) {
+ snprintf(args->errmsg, args->errmsg_len,
+ "nexthop vrf %s not found", nh_vrf);
+ return NB_ERR_VALIDATION;
+ }
+
struct interface *ifp = if_lookup_by_name(nh_ifname,
vrf->vrf_id);