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:
Robert Watson 2001-06-30 06:46:33 +00:00
parent bd69e881bd
commit e8bd25cef9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79018

View File

@ -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));