>> Any reason why I wasn't able to
copy it directly from p->payload?
You don't mention what compiler you are using, so here
is something you could check:
Since "payload"
is void *, the compiler may possibly be adding (PACKET_HEADER * sizeof(
int)) to the first but only PACKET_HEADER to the second. Unlikely,
but possible.