Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F96225955
D38469.id117216.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38469.id117216.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
@@ -1154,7 +1154,7 @@
uint16_t seq;
static int old_rrlen;
static char old_rr[MAX_IPOPTLEN];
- struct ip oip;
+ struct ip *oip;
u_char oip_header_len;
struct icmp oicmp;
const u_char *oicmp_raw;
@@ -1358,19 +1358,19 @@
return;
}
- memcpy(&oip, icmp_data_raw, sizeof(struct ip));
+ oip = __DECONST(struct ip *, icmp_data_raw);
oicmp_raw = icmp_data_raw + oip_header_len;
memcpy(&oicmp, oicmp_raw, sizeof(struct icmp));
if (((options & F_VERBOSE) && uid == 0) ||
(!(options & F_QUIET2) &&
- (oip.ip_dst.s_addr == whereto.sin_addr.s_addr) &&
- (oip.ip_p == IPPROTO_ICMP) &&
+ (oip->ip_dst.s_addr == whereto.sin_addr.s_addr) &&
+ (oip->ip_p == IPPROTO_ICMP) &&
(oicmp.icmp_type == ICMP_ECHO) &&
(oicmp.icmp_id == ident))) {
(void)printf("%zd bytes from %s: ", cc,
pr_addr(from->sin_addr));
- pr_icmph(&icp, &oip, oicmp_raw);
+ pr_icmph(&icp, oip, oicmp_raw);
} else
return;
}
diff --git a/sbin/ping/tests/ping_test.sh b/sbin/ping/tests/ping_test.sh
--- a/sbin/ping/tests/ping_test.sh
+++ b/sbin/ping/tests/ping_test.sh
@@ -178,7 +178,7 @@
}
inject_pip_body()
{
- atf_check -s exit:2 -o match:"Destination Host Unreachable" -o not-match:"01010101" python3 $(atf_get_srcdir)/injection.py pip
+ atf_check -s exit:2 -o match:"Destination Host Unreachable" -o match:"(01){40}" python3 $(atf_get_srcdir)/injection.py pip
}
inject_pip_cleanup()
{
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
@@ -894,7 +894,6 @@
"stderr": "",
"redacted": False,
},
- marks=pytest.mark.skip("XXX currently failing"),
id="_3_1_opts_NOP_40",
),
pytest.param(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 25, 3:28 AM (22 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
12726119
Default Alt Text
D38469.id117216.diff (1 KB)
Attached To
Mode
D38469: ping: Print the IP options of the original packet
Attached
Detach File
Event Timeline
Log In to Comment