+ return (ESTALE);
+ /*
+ * Get the export permission structure for this <mp, client> tuple.
+ */
+ if ((mp->mnt_flag & MNT_EXPORTED) == 0)
+ return (EACCES);
+ if (nam == NULL) {
+ np = (struct netaddrhash *)0;
+ } else {
+ /*
+ * First search for a network match.
+ */
+ np = ump->um_netaddr[NETMASK_HASH];
+ while (np) {
+ if (netaddr_match(np->neth_family, &np->neth_haddr,
+ &np->neth_hmask, nam))
+ break;
+ np = np->neth_next;
+ }
+
+ /*
+ * If not found, try for an address match.
+ */
+ if (np == (struct netaddrhash *)0) {
+ saddr = mtod(nam, struct sockaddr *);
+ np = ump->um_netaddr[NETADDRHASH(saddr)];
+ while (np) {
+ if (netaddr_match(np->neth_family,
+ &np->neth_haddr, (struct netaddrhash *)0,
+ nam))
+ break;
+ np = np->neth_next;
+ }
+ }
+ }
+ if (np == (struct netaddrhash *)0) {
+ /*
+ * If no address match, use the default if it exists.
+ */
+ if ((mp->mnt_flag & MNT_DEFEXPORTED) == 0)
+ return (EACCES);
+ np = &ump->um_defexported;
+ }