improve the pkt_queue, it's adapted for new code, needs revision, this may not compile.