From: bluhm Date: Fri, 19 Dec 2014 21:41:20 +0000 (+0000) Subject: Use a simpler expression to check the ether type in scapy. This X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9c70e3bf59975b9b55a24c9de595a22f5cb34542;p=openbsd Use a simpler expression to check the ether type in scapy. This makes the fragment tests work on FreeBSD. From Ilya Bakulin. --- diff --git a/regress/sys/net/pf_forward/ping6_mtu.py b/regress/sys/net/pf_forward/ping6_mtu.py index cc0804b8a88..7c2a5b925f8 100644 --- a/regress/sys/net/pf_forward/ping6_mtu.py +++ b/regress/sys/net/pf_forward/ping6_mtu.py @@ -26,7 +26,7 @@ if len(ans) == 0: exit(2) a=ans[0] -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ +if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Packet too big': mtu=a.payload.payload.mtu diff --git a/regress/sys/net/pf_fragment/frag.py b/regress/sys/net/pf_fragment/frag.py index 1c4b0cdad05..62bc1baab80 100644 --- a/regress/sys/net/pf_fragment/frag.py +++ b/regress/sys/net/pf_fragment/frag.py @@ -25,7 +25,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip and src "+dstaddr+" and dst "+SRC_OUT+" and icmp") a=ans[0] -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \ +if a and a.type == ETH_P_IP and \ a.payload.proto == 1 and \ a.payload.frag == 0 and a.payload.flags == 0 and \ icmptypes[a.payload.payload.type] == 'echo-reply': diff --git a/regress/sys/net/pf_fragment/frag6.py b/regress/sys/net/pf_fragment/frag6.py index 88304f46223..1fe1b03f0dc 100644 --- a/regress/sys/net/pf_fragment/frag6.py +++ b/regress/sys/net/pf_fragment/frag6.py @@ -25,7 +25,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+dstaddr+" and dst "+SRC_OUT6+" and icmp6") a=ans[0] -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ +if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/net/pf_fragment/frag6_cutnew.py b/regress/sys/net/pf_fragment/frag6_cutnew.py index 8d8c7e54dab..5c4b21bda30 100644 --- a/regress/sys/net/pf_fragment/frag6_cutnew.py +++ b/regress/sys/net/pf_fragment/frag6_cutnew.py @@ -34,7 +34,7 @@ if len(ans) == 0: print "no reply" exit(0) a=ans[0] -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ +if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/net/pf_fragment/frag6_cutold.py b/regress/sys/net/pf_fragment/frag6_cutold.py index b1444cf0fc8..8a3cb5e3c48 100644 --- a/regress/sys/net/pf_fragment/frag6_cutold.py +++ b/regress/sys/net/pf_fragment/frag6_cutold.py @@ -34,7 +34,7 @@ if len(ans) == 0: print "no reply" exit(0) a=ans[0] -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ +if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/net/pf_fragment/frag6_dropnew.py b/regress/sys/net/pf_fragment/frag6_dropnew.py index 1ae1b5d163d..710292a414c 100644 --- a/regress/sys/net/pf_fragment/frag6_dropnew.py +++ b/regress/sys/net/pf_fragment/frag6_dropnew.py @@ -38,7 +38,7 @@ if len(ans) == 0: print "no reply" exit(0) a=ans[0] -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ +if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/net/pf_fragment/frag6_dropold.py b/regress/sys/net/pf_fragment/frag6_dropold.py index 4716ef07348..8e54d72303c 100644 --- a/regress/sys/net/pf_fragment/frag6_dropold.py +++ b/regress/sys/net/pf_fragment/frag6_dropold.py @@ -38,7 +38,7 @@ if len(ans) == 0: print "no reply" exit(0) a=ans[0] -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ +if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/net/pf_fragment/frag6_ext.py b/regress/sys/net/pf_fragment/frag6_ext.py index e85db24a5b5..b0706943acc 100644 --- a/regress/sys/net/pf_fragment/frag6_ext.py +++ b/regress/sys/net/pf_fragment/frag6_ext.py @@ -25,7 +25,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+dstaddr+" and dst "+SRC_OUT6+" and icmp6") a=ans[0] -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ +if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/net/pf_fragment/frag_cutnew.py b/regress/sys/net/pf_fragment/frag_cutnew.py index a2f1a84d81b..a1866969d47 100644 --- a/regress/sys/net/pf_fragment/frag_cutnew.py +++ b/regress/sys/net/pf_fragment/frag_cutnew.py @@ -34,7 +34,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip and src "+dstaddr+" and dst "+SRC_OUT+" and icmp") a=ans[0] -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \ +if a and a.type == ETH_P_IP and \ a.payload.proto == 1 and \ a.payload.frag == 0 and a.payload.flags == 0 and \ icmptypes[a.payload.payload.type] == 'echo-reply': diff --git a/regress/sys/net/pf_fragment/frag_cutold.py b/regress/sys/net/pf_fragment/frag_cutold.py index 247998721d0..1e3b919f065 100644 --- a/regress/sys/net/pf_fragment/frag_cutold.py +++ b/regress/sys/net/pf_fragment/frag_cutold.py @@ -35,7 +35,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip and src "+dstaddr+" and dst "+SRC_OUT+" and icmp") a=ans[0] -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \ +if a and a.type == ETH_P_IP and \ a.payload.proto == 1 and \ a.payload.frag == 0 and a.payload.flags == 0 and \ icmptypes[a.payload.payload.type] == 'echo-reply': diff --git a/regress/sys/net/pf_fragment/frag_dropnew.py b/regress/sys/net/pf_fragment/frag_dropnew.py index 5f5bc338f1c..ce81baa2057 100644 --- a/regress/sys/net/pf_fragment/frag_dropnew.py +++ b/regress/sys/net/pf_fragment/frag_dropnew.py @@ -39,7 +39,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip and src "+dstaddr+" and dst "+SRC_OUT+" and icmp") a=ans[0] -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \ +if a and a.type == ETH_P_IP and \ a.payload.proto == 1 and \ a.payload.frag == 0 and a.payload.flags == 0 and \ icmptypes[a.payload.payload.type] == 'echo-reply': diff --git a/regress/sys/net/pf_fragment/frag_dropold.py b/regress/sys/net/pf_fragment/frag_dropold.py index 520a8167fde..8f4d69819a3 100644 --- a/regress/sys/net/pf_fragment/frag_dropold.py +++ b/regress/sys/net/pf_fragment/frag_dropold.py @@ -39,7 +39,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip and src "+dstaddr+" and dst "+SRC_OUT+" and icmp") a=ans[0] -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \ +if a and a.type == ETH_P_IP and \ a.payload.proto == 1 and \ a.payload.frag == 0 and a.payload.flags == 0 and \ icmptypes[a.payload.payload.type] == 'echo-reply': diff --git a/regress/sys/net/pf_fragment/ping6_cksum.py b/regress/sys/net/pf_fragment/ping6_cksum.py index 752124cdc30..fb4cbd1fa70 100644 --- a/regress/sys/net/pf_fragment/ping6_cksum.py +++ b/regress/sys/net/pf_fragment/ping6_cksum.py @@ -13,7 +13,7 @@ p=(Ether(src=SRC_MAC, dst=PF_MAC)/IPv6(src=SRC_OUT6, dst=dstaddr)/ echocksum=IPv6(str(p.payload)).payload.cksum print "echocksum=%#04x" % (echocksum) a=srp1(p, iface=SRC_IF, timeout=2) -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ +if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Packet too big': outercksum=a.payload.payload.cksum diff --git a/regress/sys/net/pf_fragment/ping6_mtu_1300.py b/regress/sys/net/pf_fragment/ping6_mtu_1300.py index e7b85afb7ae..30c220a7220 100644 --- a/regress/sys/net/pf_fragment/ping6_mtu_1300.py +++ b/regress/sys/net/pf_fragment/ping6_mtu_1300.py @@ -10,7 +10,7 @@ pid=os.getpid() payload="a" * 1452 a=srp1(Ether(src=SRC_MAC, dst=PF_MAC)/IPv6(src=SRC_OUT6, dst=dstaddr)/ ICMPv6EchoRequest(id=pid, data=payload), iface=SRC_IF, timeout=2) -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ +if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Packet too big': mtu=a.payload.payload.mtu diff --git a/regress/sys/net/pf_fragment/ping_cksum.py b/regress/sys/net/pf_fragment/ping_cksum.py index 803fb77b09b..8b4eddc5a01 100644 --- a/regress/sys/net/pf_fragment/ping_cksum.py +++ b/regress/sys/net/pf_fragment/ping_cksum.py @@ -15,7 +15,7 @@ print "ipcksum=%#04x" % (ipcksum) echocksum=IP(str(p.payload)).payload.chksum print "echocksum=%#04x" % (echocksum) a=srp1(p, iface=SRC_IF, timeout=2) -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \ +if a and a.type == ETH_P_IP and \ a.payload.proto == 1 and \ icmptypes[a.payload.payload.type] == 'dest-unreach' and \ icmpcodes[a.payload.payload.type][a.payload.payload.code] == \ diff --git a/regress/sys/net/pf_fragment/udp6_cksum.py b/regress/sys/net/pf_fragment/udp6_cksum.py index d61d84761b8..030449dac4f 100644 --- a/regress/sys/net/pf_fragment/udp6_cksum.py +++ b/regress/sys/net/pf_fragment/udp6_cksum.py @@ -13,7 +13,7 @@ p=(Ether(src=SRC_MAC, dst=PF_MAC)/IPv6(src=SRC_OUT6, dst=dstaddr)/ udpcksum=IPv6(str(p.payload)).payload.chksum print "udpcksum=%#04x" % (udpcksum) a=srp1(p, iface=SRC_IF, timeout=2) -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ +if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Packet too big': outercksum=a.payload.payload.cksum diff --git a/regress/sys/net/pf_fragment/udp_cksum.py b/regress/sys/net/pf_fragment/udp_cksum.py index 064a01da2af..296bdb3353c 100644 --- a/regress/sys/net/pf_fragment/udp_cksum.py +++ b/regress/sys/net/pf_fragment/udp_cksum.py @@ -15,7 +15,7 @@ print "ipcksum=%#04x" % (ipcksum) udpcksum=IP(str(p.payload)).payload.chksum print "udpcksum=%#04x" % (udpcksum) a=srp1(p, iface=SRC_IF, timeout=2) -if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \ +if a and a.type == ETH_P_IP and \ a.payload.proto == 1 and \ icmptypes[a.payload.payload.type] == 'dest-unreach' and \ icmpcodes[a.payload.payload.type][a.payload.payload.code] == \ diff --git a/regress/sys/netinet6/frag6/frag6.py b/regress/sys/netinet6/frag6/frag6.py index 6e99f901785..1d7013778c6 100644 --- a/regress/sys/netinet6/frag6/frag6.py +++ b/regress/sys/netinet6/frag6/frag6.py @@ -27,7 +27,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/netinet6/frag6/frag6_ext.py b/regress/sys/netinet6/frag6/frag6_ext.py index fabe23d9f91..993bb2c68cd 100644 --- a/regress/sys/netinet6/frag6/frag6_ext.py +++ b/regress/sys/netinet6/frag6/frag6_ext.py @@ -24,7 +24,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/netinet6/frag6/frag6_opt.py b/regress/sys/netinet6/frag6/frag6_opt.py index 230734ac4dc..b3a88307d5f 100644 --- a/regress/sys/netinet6/frag6/frag6_opt.py +++ b/regress/sys/netinet6/frag6/frag6_opt.py @@ -26,7 +26,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/netinet6/frag6/frag6_overatomic.py b/regress/sys/netinet6/frag6/frag6_overatomic.py index 612ef89ff94..d1bb7bdd5a4 100644 --- a/regress/sys/netinet6/frag6/frag6_overatomic.py +++ b/regress/sys/netinet6/frag6/frag6_overatomic.py @@ -29,7 +29,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/netinet6/frag6/frag6_overdrop.py b/regress/sys/netinet6/frag6/frag6_overdrop.py index e9763e0997f..97fda504a8c 100644 --- a/regress/sys/netinet6/frag6/frag6_overdrop.py +++ b/regress/sys/netinet6/frag6/frag6_overdrop.py @@ -35,7 +35,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/netinet6/frag6/frag6_overhead.py b/regress/sys/netinet6/frag6/frag6_overhead.py index cdc1b042c25..41e3d28a600 100644 --- a/regress/sys/netinet6/frag6/frag6_overhead.py +++ b/regress/sys/netinet6/frag6/frag6_overhead.py @@ -32,7 +32,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/netinet6/frag6/frag6_overhead0.py b/regress/sys/netinet6/frag6/frag6_overhead0.py index 9f0d009145b..daa09a18529 100644 --- a/regress/sys/netinet6/frag6/frag6_overhead0.py +++ b/regress/sys/netinet6/frag6/frag6_overhead0.py @@ -30,7 +30,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/netinet6/frag6/frag6_overtail.py b/regress/sys/netinet6/frag6/frag6_overtail.py index 52a8e0f70ed..6c7bf3068e4 100644 --- a/regress/sys/netinet6/frag6/frag6_overtail.py +++ b/regress/sys/netinet6/frag6/frag6_overtail.py @@ -30,7 +30,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/netinet6/frag6/frag6_permute.py b/regress/sys/netinet6/frag6/frag6_permute.py index aca6621d93b..481f506379a 100644 --- a/regress/sys/netinet6/frag6/frag6_permute.py +++ b/regress/sys/netinet6/frag6/frag6_permute.py @@ -43,7 +43,7 @@ for p in permute: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/netinet6/frag6/frag6_refrag.py b/regress/sys/netinet6/frag6/frag6_refrag.py index a0697ba5406..4813e55567c 100644 --- a/regress/sys/netinet6/frag6/frag6_refrag.py +++ b/regress/sys/netinet6/frag6/frag6_refrag.py @@ -39,7 +39,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and proto ipv6-frag") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'Fragment Header' and \ a.payload.payload.offset == 0 and \ ipv6nh[a.payload.payload.nh] == 'ICMPv6' and \ diff --git a/regress/sys/netinet6/frag6/frag6_shortatomic.py b/regress/sys/netinet6/frag6/frag6_shortatomic.py index 1d6e6360c87..4465848dc2d 100644 --- a/regress/sys/netinet6/frag6/frag6_shortatomic.py +++ b/regress/sys/netinet6/frag6/frag6_shortatomic.py @@ -31,7 +31,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/netinet6/frag6/frag6_timeout.py b/regress/sys/netinet6/frag6/frag6_timeout.py index e43984eee62..9299fe2e761 100644 --- a/regress/sys/netinet6/frag6/frag6_timeout.py +++ b/regress/sys/netinet6/frag6/frag6_timeout.py @@ -37,7 +37,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=90, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/netinet6/frag6/frag6_udpatomic.py b/regress/sys/netinet6/frag6/frag6_udpatomic.py index d77e79fbac8..632caa83f06 100644 --- a/regress/sys/netinet6/frag6/frag6_udpatomic.py +++ b/regress/sys/netinet6/frag6/frag6_udpatomic.py @@ -26,7 +26,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and udp") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'UDP' and \ a.payload.payload.sport == 7: port=a.payload.payload.dport diff --git a/regress/sys/netinet6/frag6/frag6_udpheader.py b/regress/sys/netinet6/frag6/frag6_udpheader.py index dd6b2ad1680..617cf147c09 100644 --- a/regress/sys/netinet6/frag6/frag6_udpheader.py +++ b/regress/sys/netinet6/frag6/frag6_udpheader.py @@ -27,7 +27,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and udp") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'UDP' and \ a.payload.payload.sport == 7: port=a.payload.payload.dport diff --git a/regress/sys/netinet6/frag6/frag6_udppayload.py b/regress/sys/netinet6/frag6/frag6_udppayload.py index 16efbce9041..c5bfd9a0da2 100644 --- a/regress/sys/netinet6/frag6/frag6_udppayload.py +++ b/regress/sys/netinet6/frag6/frag6_udppayload.py @@ -27,7 +27,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and udp") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'UDP' and \ a.payload.payload.sport == 7: port=a.payload.payload.dport diff --git a/regress/sys/netinet6/frag6/frag6_zerofirst.py b/regress/sys/netinet6/frag6/frag6_zerofirst.py index bbc6fdc2535..80610a34382 100644 --- a/regress/sys/netinet6/frag6/frag6_zerofirst.py +++ b/regress/sys/netinet6/frag6/frag6_zerofirst.py @@ -29,7 +29,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/netinet6/frag6/frag6_zerosecond.py b/regress/sys/netinet6/frag6/frag6_zerosecond.py index 240c96d13f9..90971f7750f 100644 --- a/regress/sys/netinet6/frag6/frag6_zerosecond.py +++ b/regress/sys/netinet6/frag6/frag6_zerosecond.py @@ -29,7 +29,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': id=a.payload.payload.id diff --git a/regress/sys/netinet6/nd6/nd6_ar.py b/regress/sys/netinet6/nd6/nd6_ar.py index 2c138951b9f..3ccf6ef49de 100644 --- a/regress/sys/netinet6/nd6/nd6_ar.py +++ b/regress/sys/netinet6/nd6/nd6_ar.py @@ -35,7 +35,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Neighbor Advertisement': tgt=a.payload.payload.tgt diff --git a/regress/sys/netinet6/nd6/nd6_dad.py b/regress/sys/netinet6/nd6/nd6_dad.py index 054b06f0864..ace040d8153 100644 --- a/regress/sys/netinet6/nd6/nd6_dad.py +++ b/regress/sys/netinet6/nd6/nd6_dad.py @@ -35,7 +35,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+lla(DST_MAC)+" and dst ff02::1 and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Neighbor Advertisement': tgt=a.payload.payload.tgt diff --git a/regress/sys/netinet6/nd6/nd6_nud.py b/regress/sys/netinet6/nd6/nd6_nud.py index b7a7c1a9cf0..4fd21825c0c 100644 --- a/regress/sys/netinet6/nd6/nd6_nud.py +++ b/regress/sys/netinet6/nd6/nd6_nud.py @@ -35,7 +35,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Neighbor Advertisement': tgt=a.payload.payload.tgt diff --git a/regress/sys/netinet6/rh0/rh0_empty.py b/regress/sys/netinet6/rh0/rh0_empty.py index 68c5ed55ad1..eeb92d10530 100644 --- a/regress/sys/netinet6/rh0/rh0_empty.py +++ b/regress/sys/netinet6/rh0/rh0_empty.py @@ -22,7 +22,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Parameter problem': pprob=a.payload.payload diff --git a/regress/sys/netinet6/rh0/rh0_final.py b/regress/sys/netinet6/rh0/rh0_final.py index 14d282539d2..e76fb798c43 100644 --- a/regress/sys/netinet6/rh0/rh0_final.py +++ b/regress/sys/netinet6/rh0/rh0_final.py @@ -22,7 +22,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Parameter problem': pprob=a.payload.payload diff --git a/regress/sys/netinet6/rh0/rh0_frag2.py b/regress/sys/netinet6/rh0/rh0_frag2.py index 667aa58eb77..a9e46770bd2 100644 --- a/regress/sys/netinet6/rh0/rh0_frag2.py +++ b/regress/sys/netinet6/rh0/rh0_frag2.py @@ -30,7 +30,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': reply=a.payload.payload diff --git a/regress/sys/netinet6/rh0/rh0_frag_empty.py b/regress/sys/netinet6/rh0/rh0_frag_empty.py index cd940a42c8f..f2939f76b24 100644 --- a/regress/sys/netinet6/rh0/rh0_frag_empty.py +++ b/regress/sys/netinet6/rh0/rh0_frag_empty.py @@ -24,7 +24,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': reply=a.payload.payload diff --git a/regress/sys/netinet6/rh0/rh0_frag_final.py b/regress/sys/netinet6/rh0/rh0_frag_final.py index 71d12e61594..cc35c629f7b 100644 --- a/regress/sys/netinet6/rh0/rh0_frag_final.py +++ b/regress/sys/netinet6/rh0/rh0_frag_final.py @@ -24,7 +24,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': reply=a.payload.payload diff --git a/regress/sys/netinet6/rh0/rh0_frag_route.py b/regress/sys/netinet6/rh0/rh0_frag_route.py index 86bdc728265..dc7b0099736 100644 --- a/regress/sys/netinet6/rh0/rh0_frag_route.py +++ b/regress/sys/netinet6/rh0/rh0_frag_route.py @@ -24,7 +24,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Parameter problem': pprob=a.payload.payload diff --git a/regress/sys/netinet6/rh0/rh0_none.py b/regress/sys/netinet6/rh0/rh0_none.py index e144c405a31..7405a0ab88c 100644 --- a/regress/sys/netinet6/rh0/rh0_none.py +++ b/regress/sys/netinet6/rh0/rh0_none.py @@ -20,7 +20,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Echo Reply': reply=a.payload.payload diff --git a/regress/sys/netinet6/rh0/rh0_route.py b/regress/sys/netinet6/rh0/rh0_route.py index 9e468b6a5bb..def084e770d 100644 --- a/regress/sys/netinet6/rh0/rh0_route.py +++ b/regress/sys/netinet6/rh0/rh0_route.py @@ -22,7 +22,7 @@ if os.fork() == 0: ans=sniff(iface=SRC_IF, timeout=3, filter= "ip6 and dst "+SRC_OUT6+" and icmp6") for a in ans: - if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \ + if a and a.type == ETH_P_IPV6 and \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ icmp6types[a.payload.payload.type] == 'Parameter problem': pprob=a.payload.payload