mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-28 12:07:10 +01:00
Modify ping so that it increases the send socket buffer size if the
user runs with privilege, allowing the sending of icmp packets with larger size (up to 48k, the default receive buffer size in ping), which is useful for network driver development testing, as well as experimentation with fragmentation. Reviewed by: wpaul
This commit is contained in:
parent
bd69e881bd
commit
e8bd25cef9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79018
@ -565,6 +565,11 @@ main(argc, argv)
|
||||
(void)setsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *)&hold,
|
||||
sizeof(hold));
|
||||
|
||||
if (!uid) {
|
||||
(void)setsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *)&hold,
|
||||
sizeof(hold));
|
||||
}
|
||||
|
||||
if (to->sin_family == AF_INET) {
|
||||
(void)printf("PING %s (%s)", hostname,
|
||||
inet_ntoa(to->sin_addr));
|
||||
|
Loading…
Reference in New Issue
Block a user