- while True:
- pkt = rxq.recv(3, ignore=sent_packets)
- if ether.haslayer(ICMPv6ND_NS):
- # read another packet in the queue in case of ICMPv6ND_NS packet
- continue
- else:
- # otherwise process the current packet
- break
- if pkt is not None:
- ether = pkt
+ ether = rxq.recv(3, ignore=sent_packets)
+ if not ether:
+ continue
+ if ether.haslayer(ICMPv6ND_NS):
+ # read another packet in the queue in case of ICMPv6ND_NS packet
+ continue
+ else:
+ # otherwise process the current packet