diff options
author | 2012-07-10 17:28:57 +0000 | |
---|---|---|
committer | 2012-07-10 17:28:57 +0000 | |
commit | 98a41332ad3db37db4b4e7f9ccdc29d40ef645f2 (patch) | |
tree | d360c9c83085d8ca064b6f7900b9b836f3ba04a6 | |
parent | Accounting for page tables, USPACE, and whatever else... as part (diff) | |
download | wireguard-openbsd-98a41332ad3db37db4b4e7f9ccdc29d40ef645f2.tar.xz wireguard-openbsd-98a41332ad3db37db4b4e7f9ccdc29d40ef645f2.zip |
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.py | 15 |
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': |