autofs-5.1.4 - use_hostname_for_mounts shouldn't prevent selection among replicas

If several replicas have been specified for a mount point,
and use_hostname_for_mount is set to "yes", the selection
between these replicas is currently disabled and the last in
the list is always chosen.

There is little point selecting between different addresses
for the one host in this case, but it is still worth
selecting between different hosts, particularly if different
weights have been specified.

This patch restores the "prune_host_list()" functionality
when use_hostname_for_mount is set, and modifies it slightly
so that only on IP address for any host:/path entry in the
config file is willl be successfully probed.  After a
success, further addresses from the same entry are skipped.
This is achieved by tracking an entry number ("ent_num") for
each 'struct host'.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Ian Kent <raven@themaw.net>
4 files changed