Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163562300
D39492.id120111.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D39492.id120111.diff
View Options
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
--- a/sbin/ping/ping.c
+++ b/sbin/ping/ping.c
@@ -1299,14 +1299,14 @@
for (i = 0; i < datalen; ++i, ++cp) {
if ((i % 16) == 8)
(void)printf("\n\t");
- (void)printf("%2x ", *cp);
+ (void)printf(" %2x", *cp);
}
(void)printf("\ndp:");
cp = &outpack[ICMP_MINLEN];
for (i = 0; i < datalen; ++i, ++cp) {
if ((i % 16) == 8)
(void)printf("\n\t");
- (void)printf("%2x ", *cp);
+ (void)printf(" %2x", *cp);
}
break;
}
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
@@ -275,6 +275,8 @@
("hlim=[0-9]*", "hlim="),
("ttl=[0-9]*", "ttl="),
("time=[0-9.-]*", "time="),
+ ("cp: .*", "cp: xx xx xx xx xx xx xx xx"),
+ ("dp: .*", "dp: xx xx xx xx xx xx xx xx"),
("\(-[0-9\.]+[0-9]+ ms\)", "(- ms)"),
("[0-9\.]+/[0-9.]+", "/"),
]
@@ -1291,6 +1293,39 @@
},
id="_0_0_special_warp",
),
+ pytest.param(
+ {
+ "src": "192.0.2.1",
+ "dst": "192.0.2.2",
+ "icmp_type": 0,
+ "icmp_code": 0,
+ "special": "wrong",
+ },
+ {
+ "returncode": 0,
+ "stdout": """\
+PATTERN: 0x01
+PING 192.0.2.2 (192.0.2.2): 56 data bytes
+64 bytes from: icmp_seq=0 ttl= time= ms
+wrong data byte #55 should be 0x1 but was 0x0
+cp: xx xx xx xx xx xx xx xx
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0
+dp: xx xx xx xx xx xx xx xx
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+
+--- 192.0.2.2 ping statistics ---
+1 packets transmitted, 1 packets received, 0.0% packet loss
+round-trip min/avg/max/stddev = /// ms
+""",
+ "stderr": "",
+ "redacted": True,
+ },
+ id="_0_0_special_wrong",
+ ),
]
@pytest.mark.parametrize("pinger_kargs, expected", pinger_testdata)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 25, 12:47 PM (17 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35473805
Default Alt Text
D39492.id120111.diff (2 KB)
Attached To
Mode
D39492: ping: Fix the spacing between the time stamp and cp/dp
Attached
Detach File
Event Timeline
Log In to Comment