*r_idx = kp->kp_remote_index;
clib_memset (iv, 0, 4);
- clib_memcpy (iv + 4, nonce, sizeof (nonce));
+ clib_memcpy (iv + 4, nonce, sizeof (*nonce));
/* this always succeeds because we know the frame is not full */
wg_output_tun_add_to_frame (vm, async_frame, kp->kp_send_index, payload_len,
if (PREDICT_FALSE (last_adj_index != adj_index))
{
peeri = wg_peer_get_by_adj_index (adj_index);
+ if (peeri == INDEX_INVALID)
+ {
+ b[0]->error = node->errors[WG_OUTPUT_ERROR_PEER];
+ goto out;
+ }
peer = wg_peer_get (peeri);
}