Use a local to avoid calloc during format_packet in callbacks