From: Weston Andros Adamson Date: Tue, 1 May 2012 18:54:39 +0000 (-0400) Subject: mountd: support IPv6 [] escaping with fsloc hosts X-Git-Tag: nfs-utils-1-2-6-rc7~13 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=946c1c81c2f38b65acff632be4d4604e3959a323;p=nfs-utils.git mountd: support IPv6 [] escaping with fsloc hosts mountd uses colons to split fsloc hosts, but this doesn't work with IPv6 addresses (they contain ':'). To fix this, mountd is changed to expect all IPv6 addresses to be escaped by '[' and ']' so colons that are part of the address may be skipped. To fix IPv6 referrals, this patch must be used with the nfsd patch that properly parses escaped IPv6 addresses in fs_location->hosts. Signed-off-by: Weston Andros Adamson Signed-off-by: Steve Dickson --- diff --git a/utils/mountd/fsloc.c b/utils/mountd/fsloc.c index 704b7a0..bc737d1 100644 --- a/utils/mountd/fsloc.c +++ b/utils/mountd/fsloc.c @@ -120,10 +120,11 @@ static struct servers *parse_list(char **list) */ static struct servers *method_list(char *data) { - char *copy, *ptr=data; + char *copy, *ptr=data, *p; char **list; int i, listsize; struct servers *rv=NULL; + bool v6esc = false; xlog(L_NOTICE, "method_list(%s)", data); for (ptr--, listsize=1; ptr; ptr=index(ptr, ':'), listsize++) @@ -134,9 +135,22 @@ static struct servers *method_list(char *data) xlog(L_NOTICE, "converted to %s", copy); if (list && copy) { ptr = copy; - for (i=0; i