diff options
-rw-r--r-- | bgpd/bgp_route.c | 3 | ||||
-rw-r--r-- | staticd/static_nb_config.c | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 775213fe4..e73908b0a 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -6597,7 +6597,7 @@ int bgp_static_set(struct vty *vty, bool negate, const char *ip_str, int ret; struct prefix p; struct bgp_static *bgp_static; - struct prefix_rd prd; + struct prefix_rd prd = {}; struct bgp_dest *pdest; struct bgp_dest *dest; struct bgp_table *table; @@ -6626,7 +6626,6 @@ int bgp_static_set(struct vty *vty, bool negate, const char *ip_str, } if (safi == SAFI_MPLS_VPN || safi == SAFI_EVPN) { - memset(&prd, 0, sizeof(prd)); ret = str2prefix_rd(rd_str, &prd); if (!ret) { vty_out(vty, "%% Malformed rd\n"); diff --git a/staticd/static_nb_config.c b/staticd/static_nb_config.c index 6673cce10..520a3ee2c 100644 --- a/staticd/static_nb_config.c +++ b/staticd/static_nb_config.c @@ -382,6 +382,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); |