OpenAFS Master Repository branch, master, updated. openafs-devel-1_5_76-4180-gdc2a4fe
Gerrit Code Review
Thu, 20 Mar 2014 14:28:46 -0700 (PDT)
The following commit has been merged in the master branch:
Author: Jeffrey Altman <email@example.com>
Date: Sat Dec 14 19:38:50 2013 -0500
vos: GetServer search for non-loopback address
GetServer() is used to obtain an IP address for the 'aname' parameter.
'aname' can be either a dotted address or a host name. If it is a dotted
address, it is returned immediately. If it is a host name, then
gethostbyname() is used to obtain an IP address.
The prior version of this function had two failings:
1. It assumed that a struct hostent only contained a single address.
It used the former h_addr field. For all platforms supported by
OpenAFS h_addr is a macro referencing the first address in the
h_addr_list array. If h_addr was a loopback address, it would
ignore any additional addresses that might be in the list.
2. It assumed that if gethostbyname(aname) returned a loopback
address as h_addr that 'aname' must be referring to the machine
that the vos command is being executed on. It therefore used
gethostname() to obtain an alternate name to use for a gethostbyname()
query. The results of this query were not checked to be a loopback.
As a result, a loopback address could be returned to the caller which
in turn could be set into the VLDB.
Reviewed-by: D Brashear <firstname.lastname@example.org>
Reviewed-by: Benjamin Kaduk <email@example.com>
Reviewed-by: Harald Barth <firstname.lastname@example.org>
Tested-by: BuildBot <email@example.com>
src/volser/vos.c | 51 ++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 38 insertions(+), 13 deletions(-)
OpenAFS Master Repository