X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=GPL%2Ftraffic_scripts%2Fpolicer.py;h=46131da2a01915ad766151b2d03553b679137bf4;hp=262d7878b6e99a8ad664c1515a24805bc06de059;hb=7829fea4a2c8936513fa95215b7d84997f814a69;hpb=624e580159dc056035d7e962582e86a000f8c3d6 diff --git a/GPL/traffic_scripts/policer.py b/GPL/traffic_scripts/policer.py index 262d7878b6..46131da2a0 100644 --- a/GPL/traffic_scripts/policer.py +++ b/GPL/traffic_scripts/policer.py @@ -26,12 +26,11 @@ """Traffic script for IPsec verification.""" import sys -import logging from ipaddress import ip_address from scapy.layers.l2 import Ether from scapy.layers.inet import IP, TCP -from scapy.layers.inet6 import IPv6, ICMPv6ND_NS +from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2 from scapy.packet import Raw from .TrafficScriptArg import TrafficScriptArg @@ -113,9 +112,13 @@ def main(): if pkt_recv.haslayer(ICMPv6ND_NS): # read another packet in the queue if the current one is ICMPv6ND_NS continue - else: - # otherwise process the current packet - break + elif pkt_recv.haslayer(ICMPv6MLReport2): + # read another packet in the queue if the current one is + # ICMPv6MLReport2 + continue + + # otherwise process the current packet + break if pkt_recv is None: raise RuntimeError(u"Rx timeout")