From nobody Tue Nov 05 02:50:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XjCWJ6T8Tz5ctlf; Tue, 05 Nov 2024 02:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XjCWJ5rz8z467Y; Tue, 5 Nov 2024 02:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730775036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2mhNnaJJTEV1xi59FIJrVacvJENkdH8DJ7bpDmhByqw=; b=nF+75kMHzb/k7vLYHhE3AHh5kVclx/F+RTTZxb717AiMbQhFiGfDgrresb/OJK/sfA1+DY 6LcIFelU1vVLNsH6YZtqJo2aNdHz9ADm4DBlVskDWxVgoFlQ9S4VpRXh3nmG+gCokyaH/3 2BfN8OxgqKw6NfM2LSJ822UwgyT9agcJSeYol9q/fyuwl3+uKROtNceOTu7uh/W1qKkdxv LLAOoJUIxp3dX5CaDtOjsvaXZWryq8HocvGJJCQg9s7TMMac7cONTbzWUjq/XWPHkYx/Fc SghELSHXCdzTSqilnytZDaNtD/httYWnRz333YraYShOcTc3ZRdIUt/22L209g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730775036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2mhNnaJJTEV1xi59FIJrVacvJENkdH8DJ7bpDmhByqw=; b=rk6b205EL9zAIOvZ4cI1XwznjZLvCbNwVOk2a9au3po4Yt8FooS2G1OJdBT2aYcsortBUk 7E+4hK5GwN6Q94GwjVoqiZ/8rPwCSRTWhlqXyfi2IfOwSomfXd6/L94DM3iQ7EpNmTE8wA cZhVZdhueKN25jmXnZlR25plvxT6+WIL3xn+V8LRN/dbbUW9JDVFNXulWzyqWBAGPd43EN JOn7D0EUDCcon0YnrH5egD0dO7KbdYhjcUKoMvWAh7k6q2kkdJj+aQmgNjARmrbSHYDJPE GwFlPzZjGT6sfetRJQL9/PPSyTfAOSriCjVp6ExLNht1vzqgxV0osZyDNzbo6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730775036; a=rsa-sha256; cv=none; b=rJaFq+zHtKxkT5dz+66a32f+j6XQ+A04R7Uj1OzEerxR3DV0ocYqQlD+sDdZbbljwFHHY5 OEHb4ExerZL/g2Ce4BZwgSZINj7WnHUvui/mjWhC5TfHaFolIGGB3W1un9WtlKfwBzgnmc /gLbSe13y3Qh8aXAPjlF5CsHL4H5c/jzwqEGqYomQDoKvjoNjiZVoGC59oqvK1LbyuV2CU SYJNzGi7ktzgtZ319m1o8jaR3W5z/ybElsB4gcS8RGi+aUtUr23A3Z1MCXQDlO93WNqaim n3ZJyFAAnCVLy7uGjMxNMxYyeEUrmuxI6ww7npSjqjH6uvFl/mH+uw39kabgrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XjCWJ5SFMz10DL; Tue, 5 Nov 2024 02:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4A52oasG089177; Tue, 5 Nov 2024 02:50:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4A52oaLU089174; Tue, 5 Nov 2024 02:50:36 GMT (envelope-from git) Date: Tue, 5 Nov 2024 02:50:36 GMT Message-Id: <202411050250.4A52oaLU089174@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 4859030ef193 - main - ping: tests: Align with Scapy defaults List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4859030ef193688153f490915794ae9ab77f012b Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=4859030ef193688153f490915794ae9ab77f012b commit 4859030ef193688153f490915794ae9ab77f012b Author: Jose Luis Duran AuthorDate: 2024-11-05 02:48:34 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-05 02:48:34 +0000 ping: tests: Align with Scapy defaults Align some of pinger() defaults with Scapy to facilitate debugging when printing packets. No functional change intended. Reviewed by: emaste, kp Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D47159 --- sbin/ping/tests/test_ping.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py index 90df07d0e5b9..cf2e46a146c8 100644 --- a/sbin/ping/tests/test_ping.py +++ b/sbin/ping/tests/test_ping.py @@ -63,14 +63,14 @@ def build_response_packet(echo, ip, icmp, oip_ihl, special): if icmp.type in icmp_id_seq_types: pkt = ip / icmp / load else: - ip.options = "" + del ip.options pkt = ip / icmp / oip / oicmp / load return pkt def generate_ip_options(opts): if not opts: - return "" + return [] routers = [ "192.0.2.10", @@ -118,7 +118,7 @@ def generate_ip_options(opts): ToolsHelper.set_sysctl("net.inet.ip.process_options", 0) options = b"\x9f" * 40 else: - options = "" + options = [] return options @@ -134,7 +134,7 @@ def pinger( icmp_code: sc.scapy.fields.MultiEnumField, # IP arguments ihl: Optional[sc.scapy.fields.BitField] = None, - flags: Optional[sc.scapy.fields.FlagsField] = None, + flags: Optional[sc.scapy.fields.FlagsField] = 0, opts: Optional[str] = None, oip_ihl: Optional[sc.scapy.fields.BitField] = None, special: Optional[str] = None, @@ -169,7 +169,7 @@ def pinger( :keyword ihl: Internet Header Length, defaults to None :type ihl: class:`scapy.fields.BitField`, optional - :keyword flags: IP flags - one of `DF`, `MF` or `evil`, defaults to None + :keyword flags: IP flags - one of `DF`, `MF` or `evil`, defaults to 0 :type flags: class:`scapy.fields.FlagsField`, optional :keyword opts: Include IP options - one of `EOL`, `NOP`, `NOP-40`, `unk`, `unk-40`, `RR`, `RR-same`, `RR-trunc`, `LSRR`, `LSRR-trunc`, `SSRR` or