1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-17 11:00:59 -05:00

Use the new host_str* functions to improve IPv6 literal support.

I've gone through everywhere we handle host names / addresses (on
command lines, in PuTTY config, in port forwarding, in X display
names, in host key storage...) and tried to make them handle IPv6
literals sensibly, by using the host_str* functions I introduced in my
previous commit. Generally it's now OK to use a bracketed IPv6 literal
anywhere a hostname might have been valid; in a few cases where no
ambiguity exists (e.g. no :port suffix is permitted anyway)
unbracketed IPv6 literals are also acceptable.

[originally from svn r10120]
This commit is contained in:
Simon Tatham
2014-01-25 15:58:54 +00:00
parent 0348f57077
commit 8da4fa5063
14 changed files with 65 additions and 78 deletions

View File

@ -261,9 +261,9 @@ int cmdline_process_param(char *p, char *value, int need_save, Conf *conf)
type = p[1]; /* 'L' or 'R' */
q = qq = strchr(value, ':');
q = qq = host_strchr(value, ':');
while (qq) {
char *qqq = strchr(qq+1, ':');
char *qqq = host_strchr(qq+1, ':');
if (qqq)
q = qq;
qq = qqq;
@ -301,7 +301,7 @@ int cmdline_process_param(char *p, char *value, int need_save, Conf *conf)
UNAVAILABLE_IN(TOOLTYPE_FILETRANSFER | TOOLTYPE_NONNETWORK);
SAVEABLE(0);
portp = strchr(value, ':');
portp = host_strchr(value, ':');
if (!portp) {
cmdline_error("-nc expects argument of form 'host:port'");
return ret;