version 1.386, 2013/10/16 22:49:39 |
version 1.387, 2013/10/16 22:58:01 |
|
|
|
|
/* |
/* |
* Attempt to resolve the supplied hostname after applying the user's |
* Attempt to resolve the supplied hostname after applying the user's |
* canonicalisation rules. Returns the address list for the host or NULL |
* canonicalization rules. Returns the address list for the host or NULL |
* if no name was found after canonicalisation. |
* if no name was found after canonicalization. |
*/ |
*/ |
static struct addrinfo * |
static struct addrinfo * |
resolve_canonicalize(char **hostp, u_int port) |
resolve_canonicalize(char **hostp, u_int port) |
|
|
if (options.proxy_command != NULL && |
if (options.proxy_command != NULL && |
options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS) |
options.canonicalize_hostname != SSH_CANONICALISE_ALWAYS) |
return NULL; |
return NULL; |
/* Don't apply canonicalisation to sufficiently-qualified hostnames */ |
/* Don't apply canonicalization to sufficiently-qualified hostnames */ |
ndots = 0; |
ndots = 0; |
for (cp = *hostp; *cp != '\0'; cp++) { |
for (cp = *hostp; *cp != '\0'; cp++) { |
if (*cp == '.') |
if (*cp == '.') |
|
|
host = cp; |
host = cp; |
} |
} |
|
|
/* If canonicalisation requested then try to apply it */ |
/* If canonicalization requested then try to apply it */ |
if (options.canonicalize_hostname != SSH_CANONICALISE_NO) |
if (options.canonicalize_hostname != SSH_CANONICALISE_NO) |
addrs = resolve_canonicalize(&host, options.port); |
addrs = resolve_canonicalize(&host, options.port); |
/* |
/* |
* If canonicalisation not requested, or if it failed then try to |
* If canonicalization not requested, or if it failed then try to |
* resolve the bare hostname name using the system resolver's usual |
* resolve the bare hostname name using the system resolver's usual |
* search rules. |
* search rules. |
*/ |
*/ |