Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Nov 2024 02:50:35 GMT
From:      Jose Luis Duran <jlduran@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 2e29bf7a2ae6 - main - ping: tests: Cleanup IPOption()s
Message-ID:  <202411050250.4A52oZcR089108@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jlduran:

URL: https://cgit.FreeBSD.org/src/commit/?id=2e29bf7a2ae66acb6e65ffc1c923cfb373af67bd

commit 2e29bf7a2ae66acb6e65ffc1c923cfb373af67bd
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2024-11-05 02:46:45 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2024-11-05 02:46:45 +0000

    ping: tests: Cleanup IPOption()s
    
    Scapy now only accepts known options with IPOption(), so our unknown
    option must be passed raw.
    
    While here, prefer the named options for EOL and NOP.
    
    Reviewed by:    emaste, kp
    Approved by:    emaste (mentor)
    Differential Revision:  https://reviews.freebsd.org/D47160
---
 sbin/ping/tests/test_ping.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py
index 8ec0f3dc74dc..90df07d0e5b9 100644
--- a/sbin/ping/tests/test_ping.py
+++ b/sbin/ping/tests/test_ping.py
@@ -85,11 +85,11 @@ def generate_ip_options(opts):
     ]
     routers_zero = [0, 0, 0, 0, 0, 0, 0, 0, 0]
     if opts == "EOL":
-        options = sc.IPOption(b"\x00")
+        options = sc.IPOption_EOL()
     elif opts == "NOP":
-        options = sc.IPOption(b"\x01")
+        options = sc.IPOption_NOP()
     elif opts == "NOP-40":
-        options = sc.IPOption(b"\x01" * 40)
+        options = sc.IPOption_NOP() * 40
     elif opts == "RR":
         ToolsHelper.set_sysctl("net.inet.ip.process_options", 0)
         options = sc.IPOption_RR(pointer=40, routers=routers)
@@ -116,7 +116,7 @@ def generate_ip_options(opts):
         options = b"\x9f"
     elif opts == "unk-40":
         ToolsHelper.set_sysctl("net.inet.ip.process_options", 0)
-        options = sc.IPOption(b"\x9f" * 40)
+        options = b"\x9f" * 40
     else:
         options = ""
     return options



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202411050250.4A52oZcR089108>