Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170970103
D38528.id117180.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D38528.id117180.diff
View Options
diff --git a/sbin/ping/tests/test_ping.py b/sbin/ping/tests/test_ping.py
--- a/sbin/ping/tests/test_ping.py
+++ b/sbin/ping/tests/test_ping.py
@@ -1023,6 +1023,118 @@
},
id="_0_0_opts_NOP",
),
+ pytest.param(
+ {
+ "src": "192.0.2.1",
+ "dst": "192.0.2.2",
+ "icmp_type": 3,
+ "icmp_code": 1,
+ "ihl": 0x4,
+ },
+ {
+ "returncode": 2,
+ "stdout": """\
+PING 192.0.2.2 (192.0.2.2): 56 data bytes
+
+--- 192.0.2.2 ping statistics ---
+1 packets transmitted, 0 packets received, 100.0% packet loss
+""",
+ "stderr": "", # "IHL too short" message not shown
+ "redacted": False,
+ },
+ id="_IHL_too_short",
+ ),
+ pytest.param(
+ {
+ "src": "192.0.2.1",
+ "dst": "192.0.2.2",
+ "icmp_type": 3,
+ "icmp_code": 1,
+ "special": "no-payload",
+ },
+ {
+ "returncode": 2,
+ "stdout": """\
+PATTERN: 0x01
+PING 192.0.2.2 (192.0.2.2): 56 data bytes
+
+--- 192.0.2.2 ping statistics ---
+1 packets transmitted, 0 packets received, 100.0% packet loss
+""",
+ "stderr": """\
+ping: quoted data too short (28 bytes) from 192.0.2.2
+""",
+ "redacted": False,
+ },
+ id="_quoted_data_too_short",
+ ),
+ pytest.param(
+ {
+ "src": "192.0.2.1",
+ "dst": "192.0.2.2",
+ "icmp_type": 3,
+ "icmp_code": 1,
+ "oip_ihl": 0x4,
+ },
+ {
+ "returncode": 2,
+ "stdout": """\
+PING 192.0.2.2 (192.0.2.2): 56 data bytes
+
+--- 192.0.2.2 ping statistics ---
+1 packets transmitted, 0 packets received, 100.0% packet loss
+""",
+ "stderr": "", # "inner IHL too short" message not shown
+ "redacted": False,
+ },
+ id="_inner_IHL_too_short",
+ ),
+ pytest.param(
+ {
+ "src": "192.0.2.1",
+ "dst": "192.0.2.2",
+ "icmp_type": 3,
+ "icmp_code": 1,
+ "oip_ihl": 0xF,
+ },
+ {
+ "returncode": 2,
+ "stdout": """\
+PING 192.0.2.2 (192.0.2.2): 56 data bytes
+
+--- 192.0.2.2 ping statistics ---
+1 packets transmitted, 0 packets received, 100.0% packet loss
+""",
+ "stderr": """\
+ping: inner packet too short (84 bytes) from 192.0.2.2
+""",
+ "redacted": False,
+ },
+ id="_inner_packet_too_short",
+ ),
+ pytest.param(
+ {
+ "src": "192.0.2.1",
+ "dst": "192.0.2.2",
+ "icmp_type": 3,
+ "icmp_code": 1,
+ "oip_ihl": 0xF,
+ "special": "no-payload",
+ },
+ {
+ "returncode": 2,
+ "stdout": """\
+PATTERN: 0x01
+PING 192.0.2.2 (192.0.2.2): 56 data bytes
+
+--- 192.0.2.2 ping statistics ---
+1 packets transmitted, 0 packets received, 100.0% packet loss
+""",
+ "stderr": "",
+ "redacted": False,
+ },
+ id="_max_inner_packet_ihl_without_payload",
+ ),
pytest.param(
{
"src": "192.0.2.1",
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Sep 8, 10:34 PM (1 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38543049
Default Alt Text
D38528.id117180.diff (3 KB)
Attached To
Mode
D38528: ping: Test IHL/quoted data/inner packet paths
Attached
Detach File
Event Timeline
Log In to Comment