From 6d33121337af8b8ddfe3c44c8a3dba4db1529787 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Tue, 14 Mar 2023 11:22:33 -0400 Subject: [PATCH] ping: Remove ifndef icmp_data guards Early versions of [1] did not have icmp_data defined, but FreeBSD has always had. Remove these guards. NetBSD [2] and OpenBSD [3] have already removed them. [1]: https://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/netinet/ip_icmp.h [2]: https://github.com/NetBSD/src/commit/203dfd34867991fd002f747d74a96f26ae80d41c [3]: https://github.com/openbsd/src/commit/d83449c83c03b86e72d642dc92bcea434310435a Reviewed by: markj MFC after: 1 week --- sbin/ping/ping.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 00026c33a479..6e069adfecfa 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1189,12 +1189,8 @@ pr_pack(char *buf, ssize_t cc, struct sockaddr_in *from, struct timespec *tv) return; } -#ifndef icmp_data - icmp_data_raw = buf + hlen + offsetof(struct icmp, icmp_ip); -#else icmp_data_raw_len = cc - (hlen + offsetof(struct icmp, icmp_data)); icmp_data_raw = buf + hlen + offsetof(struct icmp, icmp_data); -#endif /* Now the ICMP part */ cc -= hlen;