Skip to content

Commit

Permalink
Merge pull request #9338 from idryzhov/static-nb-err
Browse files Browse the repository at this point in the history
staticd: replace NB checks with assert
  • Loading branch information
rwestphal authored Aug 14, 2021
2 parents f001084 + aaddf97 commit a01b086
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
14 changes: 0 additions & 14 deletions staticd/static_nb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,6 @@ int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_cr
yang_afi_safi_identity2value(afi_safi, &afi, &safi);

rn = static_add_route(afi, safi, &prefix, NULL, s_vrf);
if (!rn) {
flog_warn(
EC_LIB_NB_CB_CONFIG_APPLY,
"route node %s creation failed",
yang_dnode_get_string(args->dnode, "./prefix"));
return NB_ERR;
}
if (vrf->vrf_id == VRF_UNKNOWN)
snprintf(
args->errmsg, args->errmsg_len,
Expand Down Expand Up @@ -752,13 +745,6 @@ int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_sr
afi = family2afi(src_prefix.family);
src_rn =
static_add_route(afi, safi, &rn->p, &src_prefix, s_vrf);
if (!src_rn) {
flog_warn(EC_LIB_NB_CB_CONFIG_APPLY,
"src rn %s creation failed",
yang_dnode_get_string(args->dnode,
"./src-prefix"));
return NB_ERR;
}
nb_running_set_entry(args->dnode, src_rn);
break;
}
Expand Down
3 changes: 1 addition & 2 deletions staticd/static_routes.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ struct route_node *static_add_route(afi_t afi, safi_t safi, struct prefix *p,
struct static_route_info *si;
struct route_table *stable = svrf->stable[afi][safi];

if (!stable)
return NULL;
assert(stable);

/* Lookup static route prefix. */
rn = srcdest_rnode_get(stable, p, src_p);
Expand Down

0 comments on commit a01b086

Please sign in to comment.