From b4e898b50b506200b143b4b91d3a5808d88327ce Mon Sep 17 00:00:00 2001 From: Alexander Bluhm Date: Wed, 11 Jan 2012 21:37:45 +0000 Subject: Do not read dstaddr from command line, get it from addr.py. --- regress/sys/netinet6/frag6/Makefile | 16 ++++++++-------- regress/sys/netinet6/frag6/frag6.py | 7 +++---- regress/sys/netinet6/frag6/frag6_ext.py | 7 +++---- regress/sys/netinet6/frag6/frag6_overdrop.py | 7 +++---- regress/sys/netinet6/frag6/frag6_overhead.py | 7 +++---- regress/sys/netinet6/frag6/frag6_overhead0.py | 7 +++---- regress/sys/netinet6/frag6/frag6_overtail.py | 7 +++---- regress/sys/netinet6/frag6/frag6_permute.py | 8 +++----- 8 files changed, 29 insertions(+), 37 deletions(-) diff --git a/regress/sys/netinet6/frag6/Makefile b/regress/sys/netinet6/frag6/Makefile index 051e929a13e..6275981aa43 100644 --- a/regress/sys/netinet6/frag6/Makefile +++ b/regress/sys/netinet6/frag6/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.2 2012/01/10 17:21:52 bluhm Exp $ +# $OpenBSD: Makefile,v 1.3 2012/01/11 21:37:44 bluhm Exp $ # The following ports must be installed: # @@ -65,49 +65,49 @@ TARGETS += frag6 run-regress-frag6: addr.py @echo '\n======== $@ ========' @echo Check ping6 reassembly - ${SUDO} python2.7 frag6.py ${DST_IN6} + ${SUDO} python2.7 frag6.py # An hop by hop options extension header before the fragment header TARGETS += frag6-ext run-regress-frag6-ext: addr.py @echo '\n======== $@ ========' @echo Check ping6 extension header reassembly - ${SUDO} python2.7 frag6_ext.py ${DST_IN6} + ${SUDO} python2.7 frag6_ext.py # fragmented packet with head overlapping first fragment TARGETS += frag6-overhead0 run-regress-frag6-overhead0: addr.py @echo '\n======== $@ ========' @echo Check ping6 head overlapping first fragment - ${SUDO} python2.7 frag6_overhead0.py ${DST_IN6} + ${SUDO} python2.7 frag6_overhead0.py # fragmented packet with head overlapping second fragment TARGETS += frag6-overhead run-regress-frag6-overhead: addr.py @echo '\n======== $@ ========' @echo Check ping6 head overlapping second fragment - ${SUDO} python2.7 frag6_overhead.py ${DST_IN6} + ${SUDO} python2.7 frag6_overhead.py # fragmented packet with tail overlapping last fragment TARGETS += frag6-overtail run-regress-frag6-overtail: addr.py @echo '\n======== $@ ========' @echo Check ping6 tail overlapping last fragment - ${SUDO} python2.7 frag6_overtail.py ${DST_IN6} + ${SUDO} python2.7 frag6_overtail.py # fragmented packet with overlap, drop future fragments TARGETS += frag6-overdrop run-regress-frag6-overdrop: addr.py @echo '\n======== $@ ========' @echo Check ping6 overlap drop future fragments - ${SUDO} python2.7 frag6_overdrop.py ${DST_IN6} + ${SUDO} python2.7 frag6_overdrop.py # fragmented packet permuted fragments TARGETS += frag6-permute run-regress-frag6-permute: addr.py @echo '\n======== $@ ========' @echo Check ping6 permuted fragments - ${SUDO} python2.7 frag6_permute.py ${DST_IN6} + ${SUDO} python2.7 frag6_permute.py REGRESS_TARGETS = ${TARGETS:S/^/run-regress-/} diff --git a/regress/sys/netinet6/frag6/frag6.py b/regress/sys/netinet6/frag6/frag6.py index 2d8b2ec7bae..610f04bfc4c 100644 --- a/regress/sys/netinet6/frag6/frag6.py +++ b/regress/sys/netinet6/frag6/frag6.py @@ -8,16 +8,15 @@ import os from addr import * from scapy.all import * -dstaddr=sys.argv[1] pid=os.getpid() payload="ABCDEFGHIJKLOMNO" -packet=IPv6(src=SRC_OUT6, dst=dstaddr)/ICMPv6EchoRequest(id=pid, data=payload) +packet=IPv6(src=SRC_OUT6, dst=DST_IN6)/ICMPv6EchoRequest(id=pid, data=payload) frag=[] frag.append(IPv6ExtHdrFragment(nh=58, id=pid, m=1)/str(packet)[40:56]) frag.append(IPv6ExtHdrFragment(nh=58, id=pid, offset=2)/str(packet)[56:64]) eth=[] for f in frag: - pkt=IPv6(src=SRC_OUT6, dst=dstaddr)/f + pkt=IPv6(src=SRC_OUT6, dst=DST_IN6)/f eth.append(Ether(src=SRC_MAC, dst=DST_MAC)/pkt) if os.fork() == 0: @@ -26,7 +25,7 @@ if os.fork() == 0: os._exit(0) ans=sniff(iface=SRC_IF, timeout=3, filter= - "ip6 and src "+dstaddr+" and dst "+SRC_OUT6+" and icmp6") + "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 \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ diff --git a/regress/sys/netinet6/frag6/frag6_ext.py b/regress/sys/netinet6/frag6/frag6_ext.py index 3eb51627fd6..44c45baebc8 100644 --- a/regress/sys/netinet6/frag6/frag6_ext.py +++ b/regress/sys/netinet6/frag6/frag6_ext.py @@ -5,16 +5,15 @@ import os from addr import * from scapy.all import * -dstaddr=sys.argv[1] pid=os.getpid() payload="ABCDEFGHIJKLOMNO" -packet=IPv6(src=SRC_OUT6, dst=dstaddr)/ICMPv6EchoRequest(id=pid, data=payload) +packet=IPv6(src=SRC_OUT6, dst=DST_IN6)/ICMPv6EchoRequest(id=pid, data=payload) frag=[] frag.append(IPv6ExtHdrFragment(nh=58, id=pid, m=1)/str(packet)[40:56]) frag.append(IPv6ExtHdrFragment(nh=58, id=pid, offset=2)/str(packet)[56:64]) eth=[] for f in frag: - pkt=IPv6(src=SRC_OUT6, dst=dstaddr)/IPv6ExtHdrHopByHop()/f + pkt=IPv6(src=SRC_OUT6, dst=DST_IN6)/IPv6ExtHdrHopByHop()/f eth.append(Ether(src=SRC_MAC, dst=DST_MAC)/pkt) if os.fork() == 0: @@ -23,7 +22,7 @@ if os.fork() == 0: os._exit(0) ans=sniff(iface=SRC_IF, timeout=3, filter= - "ip6 and src "+dstaddr+" and dst "+SRC_OUT6+" and icmp6") + "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 \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ diff --git a/regress/sys/netinet6/frag6/frag6_overdrop.py b/regress/sys/netinet6/frag6/frag6_overdrop.py index 1eace43acf5..5a78c730c35 100644 --- a/regress/sys/netinet6/frag6/frag6_overdrop.py +++ b/regress/sys/netinet6/frag6/frag6_overdrop.py @@ -12,11 +12,10 @@ import os from addr import * from scapy.all import * -dstaddr=sys.argv[1] pid=os.getpid() payload="ABCDEFGHIJKLOMNO" dummy="0123456701234567" -packet=IPv6(src=SRC_OUT6, dst=dstaddr)/ICMPv6EchoRequest(id=pid, data=payload) +packet=IPv6(src=SRC_OUT6, dst=DST_IN6)/ICMPv6EchoRequest(id=pid, data=payload) frag=[] frag.append(IPv6ExtHdrFragment(nh=58, id=pid, m=1)/str(packet)[40:56]) frag.append(IPv6ExtHdrFragment(nh=58, id=pid, offset=1)/dummy) @@ -25,7 +24,7 @@ frag.append(IPv6ExtHdrFragment(nh=58, id=pid, offset=1, m=1)/str(packet)[48:56]) frag.append(IPv6ExtHdrFragment(nh=58, id=pid, offset=2)/str(packet)[56:64]) eth=[] for f in frag: - pkt=IPv6(src=SRC_OUT6, dst=dstaddr)/f + pkt=IPv6(src=SRC_OUT6, dst=DST_IN6)/f eth.append(Ether(src=SRC_MAC, dst=DST_MAC)/pkt) if os.fork() == 0: @@ -34,7 +33,7 @@ if os.fork() == 0: os._exit(0) ans=sniff(iface=SRC_IF, timeout=3, filter= - "ip6 and src "+dstaddr+" and dst "+SRC_OUT6+" and icmp6") + "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 \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ diff --git a/regress/sys/netinet6/frag6/frag6_overhead.py b/regress/sys/netinet6/frag6/frag6_overhead.py index 295eaebab1c..e10ca263e46 100644 --- a/regress/sys/netinet6/frag6/frag6_overhead.py +++ b/regress/sys/netinet6/frag6/frag6_overhead.py @@ -10,11 +10,10 @@ import os from addr import * from scapy.all import * -dstaddr=sys.argv[1] pid=os.getpid() payload="ABCDEFGHIJKLOMNO" dummy="0123456701234567" -packet=IPv6(src=SRC_OUT6, dst=dstaddr)/ICMPv6EchoRequest(id=pid, data=payload) +packet=IPv6(src=SRC_OUT6, dst=DST_IN6)/ICMPv6EchoRequest(id=pid, data=payload) frag=[] frag.append(IPv6ExtHdrFragment(nh=58, id=pid, m=1)/str(packet)[40:48]) frag.append(IPv6ExtHdrFragment(nh=58, id=pid, offset=1, m=1)/str(packet)[48:56]) @@ -22,7 +21,7 @@ frag.append(IPv6ExtHdrFragment(nh=58, id=pid, offset=1)/dummy) frag.append(IPv6ExtHdrFragment(nh=58, id=pid, offset=2)/str(packet)[56:64]) eth=[] for f in frag: - pkt=IPv6(src=SRC_OUT6, dst=dstaddr)/f + pkt=IPv6(src=SRC_OUT6, dst=DST_IN6)/f eth.append(Ether(src=SRC_MAC, dst=DST_MAC)/pkt) if os.fork() == 0: @@ -31,7 +30,7 @@ if os.fork() == 0: os._exit(0) ans=sniff(iface=SRC_IF, timeout=3, filter= - "ip6 and src "+dstaddr+" and dst "+SRC_OUT6+" and icmp6") + "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 \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ diff --git a/regress/sys/netinet6/frag6/frag6_overhead0.py b/regress/sys/netinet6/frag6/frag6_overhead0.py index 0bfdb1c0202..621fc6d1fab 100644 --- a/regress/sys/netinet6/frag6/frag6_overhead0.py +++ b/regress/sys/netinet6/frag6/frag6_overhead0.py @@ -9,18 +9,17 @@ import os from addr import * from scapy.all import * -dstaddr=sys.argv[1] pid=os.getpid() payload="ABCDEFGHIJKLOMNO" dummy="0123456701234567" -packet=IPv6(src=SRC_OUT6, dst=dstaddr)/ICMPv6EchoRequest(id=pid, data=payload) +packet=IPv6(src=SRC_OUT6, dst=DST_IN6)/ICMPv6EchoRequest(id=pid, data=payload) frag=[] frag.append(IPv6ExtHdrFragment(nh=58, id=pid, m=1)/str(packet)[40:56]) frag.append(IPv6ExtHdrFragment(nh=58, id=pid, offset=1)/dummy) frag.append(IPv6ExtHdrFragment(nh=58, id=pid, offset=2)/str(packet)[56:64]) eth=[] for f in frag: - pkt=IPv6(src=SRC_OUT6, dst=dstaddr)/f + pkt=IPv6(src=SRC_OUT6, dst=DST_IN6)/f eth.append(Ether(src=SRC_MAC, dst=DST_MAC)/pkt) if os.fork() == 0: @@ -29,7 +28,7 @@ if os.fork() == 0: os._exit(0) ans=sniff(iface=SRC_IF, timeout=3, filter= - "ip6 and src "+dstaddr+" and dst "+SRC_OUT6+" and icmp6") + "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 \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ diff --git a/regress/sys/netinet6/frag6/frag6_overtail.py b/regress/sys/netinet6/frag6/frag6_overtail.py index 1001a8d3fba..aedc12aa27f 100644 --- a/regress/sys/netinet6/frag6/frag6_overtail.py +++ b/regress/sys/netinet6/frag6/frag6_overtail.py @@ -9,18 +9,17 @@ import os from addr import * from scapy.all import * -dstaddr=sys.argv[1] pid=os.getpid() payload="ABCDEFGHIJKLOMNO" dummy="0123456701234567" -packet=IPv6(src=SRC_OUT6, dst=dstaddr)/ICMPv6EchoRequest(id=pid, data=payload) +packet=IPv6(src=SRC_OUT6, dst=DST_IN6)/ICMPv6EchoRequest(id=pid, data=payload) frag=[] frag.append(IPv6ExtHdrFragment(nh=58, id=pid, offset=2)/str(packet)[56:64]) frag.append(IPv6ExtHdrFragment(nh=58, id=pid, offset=1)/dummy) frag.append(IPv6ExtHdrFragment(nh=58, id=pid, m=1)/str(packet)[40:56]) eth=[] for f in frag: - pkt=IPv6(src=SRC_OUT6, dst=dstaddr)/f + pkt=IPv6(src=SRC_OUT6, dst=DST_IN6)/f eth.append(Ether(src=SRC_MAC, dst=DST_MAC)/pkt) if os.fork() == 0: @@ -29,7 +28,7 @@ if os.fork() == 0: os._exit(0) ans=sniff(iface=SRC_IF, timeout=3, filter= - "ip6 and src "+dstaddr+" and dst "+SRC_OUT6+" and icmp6") + "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 \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ diff --git a/regress/sys/netinet6/frag6/frag6_permute.py b/regress/sys/netinet6/frag6/frag6_permute.py index 0df0682e675..cc5f7ff2b31 100644 --- a/regress/sys/netinet6/frag6/frag6_permute.py +++ b/regress/sys/netinet6/frag6/frag6_permute.py @@ -17,13 +17,11 @@ permute.append([2,0,1]) permute.append([1,2,0]) permute.append([2,1,0]) -dstaddr=sys.argv[1] pid=os.getpid() payload="ABCDEFGHIJKLOMNO" - for p in permute: pid += 1 - packet=IPv6(src=SRC_OUT6, dst=dstaddr)/ \ + packet=IPv6(src=SRC_OUT6, dst=DST_IN6)/ \ ICMPv6EchoRequest(id=pid, data=payload) frag=[] frag.append(IPv6ExtHdrFragment(nh=58, id=pid, m=1)/ \ @@ -34,7 +32,7 @@ for p in permute: str(packet)[56:64]) eth=[] for i in range(3): - pkt=IPv6(src=SRC_OUT6, dst=dstaddr)/frag[p[i]] + pkt=IPv6(src=SRC_OUT6, dst=DST_IN6)/frag[p[i]] eth.append(Ether(src=SRC_MAC, dst=DST_MAC)/pkt) if os.fork() == 0: @@ -43,7 +41,7 @@ for p in permute: os._exit(0) ans=sniff(iface=SRC_IF, timeout=3, filter= - "ip6 and src "+dstaddr+" and dst "+SRC_OUT6+" and icmp6") + "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 \ ipv6nh[a.payload.nh] == 'ICMPv6' and \ -- cgit v1.2.3