if (!cfgp)
{
vlib_cli_output (vm, "Ugh: msg id %d no trace config\n", msg_id);
+ munmap (hp, file_size);
return;
}
size = cfgp->size;
if (!cfgp)
{
vlib_cli_output (vm, "Ugh: msg id %d no trace config\n", msg_id);
+ munmap (hp, file_size);
return;
}
size = cfgp->size;
/* Detect the set of worker threads */
uword *p = hash_get_mem (tm->thread_registrations_by_name, "workers");
+ /* Should never happen, shut up Coverity warning */
+ if (p == 0)
+ return clib_error_return (0, "no worker registrations?");
+
vlib_thread_registration_t *tr = (vlib_thread_registration_t *) p[0];
int worker_thread_first = tr->first_index;
int worker_thread_count = tr->count;
/* Detect the set of worker threads */
uword *p = hash_get_mem (tm->thread_registrations_by_name, "workers");
+ /* Should never happen, shut up Coverity warning */
+ if (p == 0)
+ return clib_error_return (0, "no worker registrations?");
+
vlib_thread_registration_t *tr = (vlib_thread_registration_t *) p[0];
int worker_thread_first = tr->first_index;
int worker_thread_count = tr->count;
/* Detect the set of worker threads */
p = hash_get_mem (tm->thread_registrations_by_name, "workers");
+
+ /* Should never happen, shut up Coverity warning */
+ if (p == 0)
+ return clib_error_return (0, "no worker registrations?");
+
tr = (vlib_thread_registration_t *) p[0];
cfg = &devconf->hqos;
if (devconf->hqos_enabled)
{
rv = dpdk_port_setup_hqos (xd, &devconf->hqos);
- if (rv < 0)
+ if (rv)
return rv;
}
vlib_buffer_advance(p0, - ethernet_buffer_header_size(p0));
eth0 = vlib_buffer_get_current(p0);
clib_memcpy(eth0->dst_address, eth0->src_address, 6);
- clib_memcpy(eth0->src_address, eth_if0->address, 6);
+ if (eth_if0)
+ clib_memcpy(eth0->src_address, eth_if0->address, 6);
/* Setup input and output sw_if_index for packet */
ASSERT(vnet_buffer(p0)->sw_if_index[VLIB_RX] == sw_if_index0);
/* Wait for a reply... */
W;
-
- /* Return the good/bad news */
- return (vam->retval);
}
static int
mp->_vl_msg_id = ntohs (VL_API_TAP_CONNECT);
mp->client_index = tm->my_client_index;
mp->context = 0xdeadbeef;
- clib_memcpy (mp->tap_name, name, strlen (name));
+ strncpy ((char *) mp->tap_name, name, sizeof (mp->tap_name) - 1);
mp->use_random_mac = 1;
vl_msg_api_send_shmem (tm->vl_input_queue, (u8 *) & mp);
}