diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2001-06-30 06:46:33 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2001-06-30 06:46:33 +0000 |
commit | e8bd25cef965b7ea6bdd4de6cd9f337124662158 (patch) | |
tree | ba9a3b28965837d8de8e81027de449eb37589110 /sbin | |
parent | bd69e881bda1194ed7e8be29b1fa77ef26ac8043 (diff) | |
download | src-e8bd25cef965b7ea6bdd4de6cd9f337124662158.tar.gz src-e8bd25cef965b7ea6bdd4de6cd9f337124662158.zip |
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
Notes
Notes:
svn path=/head/; revision=79018
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ping/ping.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 1209dc894090..a0117f415f40 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -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)); |