Merge pull request #8665 from volta-networks/fix_pathd_coverity

pathd: Clean coverity issues after merge pathd link state feature.
This commit is contained in:
Olivier Dugeon 2021-05-19 14:16:00 +02:00 committed by GitHub
commit 587a1dfa39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 8 deletions

View File

@ -351,8 +351,6 @@ static int segment_list_has_src_dst(
nb_cli_enqueue_change(vty, xpath, NB_OP_MODIFY,
"ipv6_adjacency");
node_src_id = adj_src_ipv6_str;
} else {
return CMD_ERR_NO_MATCH;
}
/* addresses */
snprintf(xpath, XPATH_MAXLEN, "./segment[index='%s']/nai/local-address",
@ -421,8 +419,6 @@ int segment_list_has_prefix(
sizeof(buf_prefix));
pre_ipaddr.ipa_type = IPADDR_V6;
pre_ipaddr.ip._v6_addr = prefix_cli.u.prefix6;
} else {
return CMD_ERR_NO_MATCH;
}
snprintf(xpath, XPATH_MAXLEN, "./segment[index='%s']/nai/local-address",
index_str);
@ -524,7 +520,7 @@ DEFPY(srte_segment_list_segment, srte_segment_list_segment_cmd,
if (status != CMD_SUCCESS)
return status;
} else {
segment_list_has_prefix(
status = segment_list_has_prefix(
vty, xpath, index, index_str, prefix_ipv4,
prefix_ipv4_str, prefix_ipv6, prefix_ipv6_str, has_algo,
algo, algo_str, has_iface_id, iface_id, iface_id_str);

View File

@ -1273,7 +1273,8 @@ void handle_pcep_comp_reply(struct ctrl_state *ctrl_state,
* pathd API is thread safe, we could get a new path */
if (pcc_state->caps.is_stateful) {
PCEP_DEBUG("%s Delegating undefined dynamic path %s to PCE %s",
pcc_state->tag, path->name, pcc_state->originator);
pcc_state->tag, req->path->name,
pcc_state->originator);
path = pcep_copy_path(req->path);
path->is_delegated = true;
send_report(pcc_state, path);

View File

@ -195,14 +195,16 @@ int srte_segment_entry_set_nai(struct srte_segment_entry *segment,
struct ipaddr *remote_ip, uint32_t remote_iface,
uint8_t algo, uint8_t pref_len)
{
int32_t status = 0;
struct prefix pre = {0};
segment->nai_type = type;
memcpy(&segment->nai_local_addr, local_ip, sizeof(struct ipaddr));
if (!segment || !local_ip || !remote_ip)
return 1;
segment->nai_type = type;
memcpy(&segment->nai_local_addr, local_ip, sizeof(struct ipaddr));
switch (type) {
case SRTE_SEGMENT_NAI_TYPE_IPV4_NODE:
case SRTE_SEGMENT_NAI_TYPE_IPV6_NODE: