@@ -401,7 +401,7 @@ configure_qos(const struct sbrec_port_binding *pb,
q->queue_id = queue_id;
}
free(q->network);
- q->network = network ? xstrdup(network) : NULL;
+ q->network = xstrdup(network);
q->min_rate = min_rate;
q->max_rate = max_rate;
q->burst = burst;
@@ -2388,15 +2388,12 @@ lflow_handle_changed_lbs(struct lflow_ctx_in *l_ctx_in,
struct lflow_ctx_out *l_ctx_out,
const struct uuidset *deleted_lbs,
const struct uuidset *updated_lbs,
- const struct uuidset *new_lbs,
- const struct hmap *old_lbs)
+ const struct uuidset *new_lbs)
{
const struct ovn_controller_lb *lb;
struct uuidset_node *uuid_node;
UUIDSET_FOR_EACH (uuid_node, deleted_lbs) {
- lb = ovn_controller_lb_find(old_lbs, &uuid_node->uuid);
-
VLOG_DBG("Remove hairpin flows for deleted load balancer "UUID_FMT,
UUID_ARGS(&uuid_node->uuid));
ofctrl_remove_flows(l_ctx_out->flow_table, &uuid_node->uuid);
@@ -178,8 +178,7 @@ bool lflow_handle_changed_lbs(struct lflow_ctx_in *l_ctx_in,
struct lflow_ctx_out *l_ctx_out,
const struct uuidset *deleted_lbs,
const struct uuidset *updated_lbs,
- const struct uuidset *new_lbs,
- const struct hmap *old_lbs);
+ const struct uuidset *new_lbs);
bool lflow_handle_changed_fdbs(struct lflow_ctx_in *, struct lflow_ctx_out *);
void lflow_destroy(void);
@@ -4589,8 +4589,7 @@ lflow_output_lb_data_handler(struct engine_node *node, void *data)
bool handled = lflow_handle_changed_lbs(&l_ctx_in, &l_ctx_out,
&lb_data->deleted,
&lb_data->updated,
- &lb_data->new,
- &lb_data->old_lbs);
+ &lb_data->new);
engine_set_node_state(node, EN_UPDATED);
return handled;
@@ -4507,17 +4507,11 @@ ipv6_ra_send(struct rconn *swconn, struct ipv6_ra_state *ra)
uint64_t packet_stub[128 / 8];
struct dp_packet packet;
- uint16_t router_lt = IPV6_ND_RA_LIFETIME;
-
- if (!router_lt) {
- /* Reset PRF to MEDIUM if router lifetime is not set */
- ra->config->mo_flags &= ~IPV6_ND_RA_OPT_PRF_LOW;
- }
dp_packet_use_stub(&packet, packet_stub, sizeof packet_stub);
compose_nd_ra(&packet, ra->config->eth_src, ra->config->eth_dst,
&ra->config->ipv6_src, &ra->config->ipv6_dst,
- 255, ra->config->mo_flags, htons(router_lt), 0, 0,
+ 255, ra->config->mo_flags, htons(IPV6_ND_RA_LIFETIME), 0, 0,
ra->config->mtu);
for (int i = 0; i < ra->config->prefixes.n_ipv6_addrs; i++) {
@@ -131,7 +131,6 @@ engine_dump_stats(struct unixctl_conn *conn, int argc,
const char *dump_eng_node_name = (argc > 1 ? argv[1] : NULL);
const char *dump_stat_type = (argc > 2 ? argv[2] : NULL);
- bool success = true;
for (size_t i = 0; i < engine_n_nodes; i++) {
struct engine_node *node = engine_nodes[i];
@@ -163,11 +162,8 @@ engine_dump_stats(struct unixctl_conn *conn, int argc,
break;
}
}
- if (success) {
- unixctl_command_reply(conn, ds_cstr(&dump));
- } else {
- unixctl_command_reply_error(conn, "Invalid stat type");
- }
+
+ unixctl_command_reply(conn, ds_cstr(&dump));
ds_destroy(&dump);
}
@@ -644,7 +644,6 @@ next:
p++;
}
}
- goto next;
} else {
lex_error(token,
"`/' is only valid as part of `//' or `/*'.");
@@ -38,7 +38,6 @@ test_ipam_get_unused_ip(struct ovs_cmdl_context *ctx)
}
init_ipam_info(&info, &config, "Unused IP test");
- bool fail = false;
struct ds output = DS_EMPTY_INITIALIZER;
struct ds err = DS_EMPTY_INITIALIZER;
for (size_t i = 0; i < num_ips; i++) {
@@ -50,9 +49,6 @@ test_ipam_get_unused_ip(struct ovs_cmdl_context *ctx)
}
printf("%s", ds_cstr(&output));
- if (fail) {
- fprintf(stderr, "%s", ds_cstr(&err));
- }
smap_destroy(&config);
destroy_ipam_info(&info);
The coverity static analysis identified a few places with extra checks and dead code that cannot be logically reached. Remove this dead code from the codebase. Signed-off-by: Ales Musil <amusil@redhat.com> --- controller/binding.c | 2 +- controller/lflow.c | 5 +---- controller/lflow.h | 3 +-- controller/ovn-controller.c | 3 +-- controller/pinctrl.c | 8 +------- lib/inc-proc-eng.c | 8 ++------ lib/lex.c | 1 - northd/test-ipam.c | 4 ---- 8 files changed, 7 insertions(+), 27 deletions(-)