[PATCH v2 10/12] packet: Move packet length checks into packet_check_range()