From: "J. Bruce Fields" <bfields@fieldses.org>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Wangminlan <wangminlan@huawei.com>, Neil Brown <neilb@suse.de>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: Different sequence of "exportfs" produce different effects on nfs client mounts
Date: Thu, 17 Oct 2013 09:18:10 -0400 [thread overview]
Message-ID: <20131017131810.GG19067@fieldses.org> (raw)
In-Reply-To: <CB4DB7B1-5EEA-47D0-9CAD-CC69AF868182@oracle.com>
On Thu, Oct 17, 2013 at 09:14:02AM -0400, Chuck Lever wrote:
> Hi-
>
> 281 if (ident[0] == '\0')
> 282 return MCL_ANONYMOUS;
> 283 if (ident[0] == '@') {
> 284 #ifndef HAVE_INNETGR
> 285 xlog(L_WARNING, "netgroup support not compiled in");
> 286 #endif
> 287 return MCL_NETGROUP;
> 288 }
> 289 for (sp = ident; *sp; sp++) {
> 290 if (*sp == '*' || *sp == '?' || *sp == '[')
> 291 return MCL_WILDCARD;
> 292 if (*sp == '/')
> 293 return MCL_SUBNETWORK;
> 294 if (*sp == '\\' && sp[1])
> 295 sp++;
> 296 }
>
> is still in play today. The "host_pton()" code you posted was added by commit 502edf1d just after this paragraph. But here is what that commit replaced.
>
> - /* check for N.N.N.N */
> - sp = ident;
> - if(!isdigit(*sp) || strtoul(sp, &sp, 10) > 255 || *sp != '.') return MCL_FQDN;
> - sp++; if(!isdigit(*sp) || strtoul(sp, &sp, 10) > 255 || *sp != '.') return MCL_F
> - sp++; if(!isdigit(*sp) || strtoul(sp, &sp, 10) > 255 || *sp != '.') return MCL_F
> - sp++; if(!isdigit(*sp) || strtoul(sp, &sp, 10) > 255 || *sp != '\0') return MCL_
> - /* we lie here a bit. but technically N.N.N.N == N.N.N.N/32 :) */
> - return MCL_SUBNETWORK;
> +
> + /*
> + * Treat unadorned IP addresses as MCL_SUBNETWORK.
> + * Everything else is MCL_FQDN.
> + */
> + ai = host_pton(ident);
> + if (ai != NULL) {
> + freeaddrinfo(ai);
> + return MCL_SUBNETWORK;
> + }
> +
> + return MCL_FQDN;
> }
>
> The replaced logic also treats IP addresses as MCL_SUBNETWORK. That's from commit 54669c98 in 2005. Neil, do you remember why this semantic change was made?
Um, sorry Neil, looks like Chuck and I were both searching the git logs
at the same time!
--b.
next prev parent reply other threads:[~2013-10-17 13:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-14 2:16 Different sequence of "exportfs" produce different effects on nfs client mounts Wangminlan
2013-10-14 17:45 ` J. Bruce Fields
2013-10-15 6:39 ` Wangminlan
2013-10-15 15:49 ` J. Bruce Fields
2013-10-16 1:22 ` Wangminlan
2013-10-17 7:16 ` Wangminlan
2013-10-17 13:14 ` Chuck Lever
2013-10-17 13:18 ` J. Bruce Fields [this message]
2013-10-17 21:32 ` NeilBrown
2013-10-20 22:49 ` NeilBrown
2013-10-21 9:47 ` Wangminlan
2013-10-17 13:16 ` J. Bruce Fields
-- strict thread matches above, loose matches on Subject: below --
2013-10-11 20:15 [PATCH] nfs: Remove useless 'error' assignment Geyslan G. Bem
2013-10-14 1:20 ` Different sequence of "exportfs" produce different effects on nfs client mounts Wangminlan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131017131810.GG19067@fieldses.org \
--to=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=wangminlan@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).