Followup to 26cfdc4, more possible NULL deref by Coverity.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Cleanup old SYSV references obsoleted by POSIX.1-2001

* Replace srand48()/srandom() with srand()
* Replace lrand48()/random() with rand()
* Remove setpgrp(), uses setsid() instead
* Simplify defs.h and remove SYSV define in configure script

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Replace strncpy() with memcpy() to struct ifreq ifnames

The strncpy() syscall does not terminate with zero, which in the case of
struct ifreq interface names does not matter. For shorter names the
callee should have setup the source string to be NULL terminated. This
should silence Coverity Scan CID #71281 and #71287.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
icmp.c: Sanity check IP header length before using as array index

Coverity CID #71307

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>