p3.packet: Fix the packet length calculation