mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 00:13:40 +00:00
bgpd: Check return from generic_set_add
Coverity found a couple of spots where FRR was ignoring the return code of generic_set_add. Just follow the code pattern for the rest of the usage in the code. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
3f220bc814
commit
16b398fa5c
@ -2440,6 +2440,7 @@ void lib_route_map_entry_set_action_rmap_set_action_aggregator_finish(
|
||||
const char *asn;
|
||||
const char *addr;
|
||||
char *argstr;
|
||||
int ret;
|
||||
|
||||
/* Add configuration. */
|
||||
rhc = nb_running_get_entry(args->dnode, NULL, true);
|
||||
@ -2456,8 +2457,15 @@ void lib_route_map_entry_set_action_rmap_set_action_aggregator_finish(
|
||||
rhc->rhc_rule = "aggregator as";
|
||||
rhc->rhc_event = RMAP_EVENT_SET_DELETED;
|
||||
|
||||
generic_set_add(rhc->rhc_rmi, rhc->rhc_rule, argstr,
|
||||
args->errmsg, args->errmsg_len);
|
||||
ret = generic_set_add(rhc->rhc_rmi, rhc->rhc_rule, argstr, args->errmsg,
|
||||
args->errmsg_len);
|
||||
/*
|
||||
* At this point if this is not a successful operation
|
||||
* bgpd is about to crash. Let's just cut to the
|
||||
* chase and do it.
|
||||
*/
|
||||
assert(ret == CMD_SUCCESS);
|
||||
|
||||
XFREE(MTYPE_ROUTE_MAP_COMPILED, argstr);
|
||||
}
|
||||
/*
|
||||
@ -2604,6 +2612,7 @@ lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_finish(
|
||||
enum ecommunity_lb_type lb_type;
|
||||
char str[VTY_BUFSIZ];
|
||||
uint16_t bandwidth;
|
||||
int ret;
|
||||
|
||||
/* Add configuration. */
|
||||
rhc = nb_running_get_entry(args->dnode, NULL, true);
|
||||
@ -2629,9 +2638,14 @@ lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_finish(
|
||||
if (yang_dnode_get_bool(args->dnode, "./two-octet-as-specific"))
|
||||
strlcat(str, " non-transitive", sizeof(str));
|
||||
|
||||
generic_set_add(rhc->rhc_rmi,
|
||||
"extcommunity bandwidth", str,
|
||||
args->errmsg, args->errmsg_len);
|
||||
ret = generic_set_add(rhc->rhc_rmi, "extcommunity bandwidth", str,
|
||||
args->errmsg, args->errmsg_len);
|
||||
/*
|
||||
* At this point if this is not a successful operation
|
||||
* bgpd is about to crash. Let's just cut to the
|
||||
* chase and do it.
|
||||
*/
|
||||
assert(ret == CMD_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user