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(