summaryrefslogtreecommitdiffstats
path: root/src/plugins/igmp
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-07-10 05:26:01 -0700
committerDamjan Marion <dmarion@me.com>2018-07-10 21:23:09 +0000
commit4555bb4ffa750ff5c50f030851fb21881ce285bb (patch)
tree05bd188f5f46ef7683d6a71bae7c374d53cb8791 /src/plugins/igmp
parentde450cb3cca111c1c8545b41b9e83f1212465a92 (diff)
IGMP: coverity found defects
Change-Id: Id6aba75c30712e9a0ac7b3075bd6cfc49d6bec36 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/plugins/igmp')
-rw-r--r--src/plugins/igmp/igmp_api.c2
-rw-r--r--src/plugins/igmp/igmp_cli.c8
-rw-r--r--src/plugins/igmp/igmp_pkt.c4
3 files changed, 10 insertions, 4 deletions
diff --git a/src/plugins/igmp/igmp_api.c b/src/plugins/igmp/igmp_api.c
index 71fb3e22089..06bf26bbc17 100644
--- a/src/plugins/igmp/igmp_api.c
+++ b/src/plugins/igmp/igmp_api.c
@@ -134,7 +134,7 @@ send_igmp_details (unix_shared_memory_queue_t * q, igmp_main_t * im,
mp->context = context;
mp->sw_if_index = htonl (config->sw_if_index);
clib_memcpy (mp->saddr.address, &src->key->ip4, sizeof (src->key->ip4));
- clib_memcpy (mp->gaddr.address, &group->key->ip4, sizeof (group->key->ip6));
+ clib_memcpy (mp->gaddr.address, &group->key->ip4, sizeof (group->key->ip4));
vl_msg_api_send_shmem (q, (u8 *) & mp);
}
diff --git a/src/plugins/igmp/igmp_cli.c b/src/plugins/igmp/igmp_cli.c
index 5f09589c644..df8fb642719 100644
--- a/src/plugins/igmp/igmp_cli.c
+++ b/src/plugins/igmp/igmp_cli.c
@@ -84,7 +84,7 @@ igmp_listen_command_fn (vlib_main_t * vm, unformat_input_t * input,
unformat_input_t _line_input, *line_input = &_line_input;
clib_error_t *error = NULL;
u8 enable = 1;
- ip46_address_t saddr, gaddr;
+ ip46_address_t saddr, *saddrs = NULL, gaddr;
vnet_main_t *vnm = vnet_get_main ();
u32 sw_if_index;
int rv;
@@ -108,7 +108,8 @@ igmp_listen_command_fn (vlib_main_t * vm, unformat_input_t * input,
(line_input, "int %U", unformat_vnet_sw_interface, vnm,
&sw_if_index));
else
- if (unformat (line_input, "saddr %U", unformat_ip46_address, &saddr));
+ if (unformat (line_input, "saddr %U", unformat_ip46_address, &saddr))
+ vec_add1 (saddrs, saddr);
else
if (unformat (line_input, "gaddr %U", unformat_ip46_address, &gaddr));
else
@@ -127,7 +128,7 @@ igmp_listen_command_fn (vlib_main_t * vm, unformat_input_t * input,
goto done;
}
- rv = igmp_listen (vm, enable, sw_if_index, &saddr, &gaddr);
+ rv = igmp_listen (vm, enable, sw_if_index, saddrs, &gaddr);
if (rv == -1)
{
@@ -145,6 +146,7 @@ igmp_listen_command_fn (vlib_main_t * vm, unformat_input_t * input,
done:
unformat_free (line_input);
+ vec_free (saddrs);
return error;
}
diff --git a/src/plugins/igmp/igmp_pkt.c b/src/plugins/igmp/igmp_pkt.c
index 5dd829de712..1fd240c7d9a 100644
--- a/src/plugins/igmp/igmp_pkt.c
+++ b/src/plugins/igmp/igmp_pkt.c
@@ -148,6 +148,10 @@ igmp_pkt_tx (igmp_pkt_build_t * bk)
vm = vlib_get_main ();
config = igmp_config_lookup (bk->sw_if_index);
+
+ if (NULL == config)
+ return;
+
f = vlib_get_frame_to_node (vm, ip4_rewrite_mcast_node.index);
to_next = vlib_frame_vector_args (f);