git: 6d33121337af - main - ping: Remove ifndef icmp_data guards
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 14 Mar 2023 15:58:19 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=6d33121337af8b8ddfe3c44c8a3dba4db1529787
commit 6d33121337af8b8ddfe3c44c8a3dba4db1529787
Author: Jose Luis Duran <jlduran@gmail.com>
AuthorDate: 2023-03-14 15:22:33 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-03-14 15:58:03 +0000
ping: Remove ifndef icmp_data guards
Early versions of <netinet/ip_icmp.h> [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;