summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2012-07-10 17:28:58 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2012-07-10 17:28:58 +0000
commit3671c8df0fcddd23dbac584e79c861ff7c4ce654 (patch)
treecd1fa09e43f3d600b5e8caa8a44625b7117cfb26
parent3dc16c06f0e019720a20f0dc7039a84faa6c3ad7 (diff)
Add a workaround that scapy srp1() cannot detect ICMP6 error replies
with broken checksums in the quoted IPv6 packet. Fork a process to sendp() the packet in the background and sniff() the reply manually in the foreground.
-rw-r--r--regress/sys/net/pf_forward/ping6_mtu.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/regress/sys/net/pf_forward/ping6_mtu.py b/regress/sys/net/pf_forward/ping6_mtu.py
index d0b660f0300..cc0804b8a88 100644
--- a/regress/sys/net/pf_forward/ping6_mtu.py
+++ b/regress/sys/net/pf_forward/ping6_mtu.py
@@ -12,7 +12,20 @@ payload="a" * 1452
ip=IPv6(src=SRC_OUT6, dst=dstaddr)/ICMPv6EchoRequest(id=pid, data=payload)
iplen=IPv6(str(ip)).plen
eth=Ether(src=SRC_MAC, dst=PF_MAC)/ip
-a=srp1(eth, iface=SRC_IF, timeout=2)
+
+# work around the broken sniffing of packages with bad checksum
+#a=srp1(eth, iface=SRC_IF, timeout=2)
+if os.fork() == 0:
+ time.sleep(1)
+ sendp(eth, iface=SRC_IF)
+ os._exit(0)
+ans=sniff(iface=SRC_IF, timeout=3, filter=
+ "ip6 and dst "+SRC_OUT6+" and icmp6")
+if len(ans) == 0:
+ print "no packet sniffed"
+ exit(2)
+a=ans[0]
+
if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Packet too big':