ninfod: Fix more unused variables.

| ni_ifaddrs.c: In function ‘ni_ifaddrs’:
| ni_ifaddrs.c:389:14: warning: variable ‘nlm_scope’ set but not used [-Wunused-but-set-variable]
| ni_ifaddrs.c:353:13: warning: variable ‘ifflist’ set but not used [-Wunused-but-set-variable]
| ni_ifaddrs.c:322:6: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Jan Synacek <jsynacek@redhat.com>
arping: fix arping hang if SIGALRM is blocked

Unblock SIGALRM so that the previously called alarm() can prevent
recvfrom() from blocking forever in case the inherited procmask is
blocking SIGALRM and no packet is received.

Reported-by: Rui Prior <rprior@dcc.fc.up.pt>
RH-Bugzilla: #1085971
Signed-off-by: Jan Synacek <jsynacek@redhat.com>
ping_common.c: fix message flood when EPERM is encountered in ping

When icmp packet is sent and EPERM is encountered, next packet should be
sent after the built-in interval, not immediately.

Reported-by: Sami Farin <hvtaifwkbgefbaei@gmail.com>
RH-Bugzilla: #1061867
Signed-off-by: Jan Synacek <jsynacek@redhat.com>
arping: Avoid confusing local names

The functions find_device_by_ifaddrs(), find_device_by_sysfs() and
find_device_by_ioctl() all use a local variable named 'count'.  These are
unrelated to the important global variable 'count', which is confusing.

This patch renames them to be less misleading.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
arping: Use monotonic clock for timeouts

Currently arping uses gettimeofday() to check if its timeout parameter has
expired.  This can cause problems if the system time is adjusted backwards
with settimeofday() while arping is running, causing arping to freeze for
long periods of time.

This situation can occur when running arping for duplicate address
detection during network bringup at boot.  With modern parallel init script
setups, the arping could well run in parallel with hwclock operations which
could adjust the date backwards.  For some reason this seems to be
particularly common when running under VMware.

This patch switches arping to using clock_gettime(CLOCK_MONOTONIC) to avoid
this problem.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
arping: Clarify and correct interaction of -c and -w options

The man page is a little unclear, but it seems to say that when -w is not
used, -c causes arping to terminate after sending 'count' packets, but if
-w *is* specified then it terminates only after *receiving* 'count'
packets (or when the timeout expires).  That's not what the code actually
does, or ever did.

This patch clarifies the man page slightly, and corrects the code to
actually implement the descibed behaviour.  This has repeatedly been fixed
incorrectly in Red Hat's packages, causing other problems.  With any luck
this will finally fix it properly.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Merge pull request #4 from jsynacek/devel2