mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04: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
1 changed files with 5 additions and 0 deletions
|
|
@ -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 a new issue