freebsd-dev/sbin/ping
Eugene Grosbein c0a3773ad2 ping(8): improve diagnostics in case of wrong arguments.
For example, in case of super-user:
$ sudo ping -s -64 127.0.0.1
PING 127.0.0.1 (127.0.0.1): -64 data bytes
ping: sendto: Invalid argument

For unprivileged user:
$ ping -s -64 127.0.0.1
ping: packet size too large: 18446744073709551552 > 56: Operation not permitted

Fix this by switching from strtoul() to strtol() for integer arguments
and adding explicit checks for negative values.

MFC after:	1 month
2018-11-08 09:45:13 +00:00
..
Makefile Allow dhclient and ping to build WITHOUT_DYNAMICROOT 2018-09-09 17:26:44 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
ping.8 Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
ping.c ping(8): improve diagnostics in case of wrong arguments. 2018-11-08 09:45:13 +00:00