Make packets.size() equal hdr->num_packets, so range-based for loops can
be used to iterate over all packets in the callback function.