Replace allocpkt with copy since it retains all fields as is.