ping tests: fix for scapy-2.6.0

Scapy 2.6.0 now appears to parse the IPOption during construction, and it then
gets confused at a single-byte option. IP Options typically contain at least a 1
byte type and 1 byte length. Avoid this by just returning the raw bytes, rather
than an IPOption object.

MFC after:	1 week
Reviewed by:	Jose Luis Duran <jlduran@gmail.com>
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D47151
This commit is contained in:
Kristof Provost 2024-10-16 09:57:06 +02:00
parent bf8d4cfe34
commit 2926c25942

View File

@ -113,7 +113,7 @@ def generate_ip_options(opts):
options = sc.IPOption_SSRR(length=3, routers=routers_zero)
elif opts == "unk":
ToolsHelper.set_sysctl("net.inet.ip.process_options", 0)
options = sc.IPOption(b"\x9f")
options = b"\x9f"
elif opts == "unk-40":
ToolsHelper.set_sysctl("net.inet.ip.process_options", 0)
options = sc.IPOption(b"\x9f" * 40)