]> git.puffer.fish Git - mirror/frr.git/commitdiff
pathd: Clean coverity issues after merge pathd link state feature. 8665/head
authorJavier Garcia <javier.garcia@voltanet.io>
Thu, 13 May 2021 11:17:44 +0000 (13:17 +0200)
committerJavier Garcia <javier.garcia@voltanet.io>
Tue, 18 May 2021 17:50:41 +0000 (19:50 +0200)
Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
pathd/path_cli.c
pathd/path_pcep_pcc.c
pathd/pathd.c

index 7a28449e4e97699864d7cb91b2b12eed2748ed58..5194579b62fc524a8473a523c84e43239f05c781 100644 (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);
index 9af21488190539e21b70dabe3d56d569dc1b23c8..779c400b8650ee2f554f19f4926926167fd0fb0d 100644 (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);
index 2462b08306f63e3109089ec7cbb6e0b056e1241e..9dc3a41638effe16ed7024fadbaec04f8da3da3f 100644 (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: