public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 04/12] mountd: support IPv6 in mountlist_del_all()
Date: Mon, 13 Sep 2010 13:21:28 -0400	[thread overview]
Message-ID: <20100913172128.19017.28249.stgit@seurat.1015granger.net> (raw)
In-Reply-To: <20100913171844.19017.13446.stgit@seurat.1015granger.net>

Replace IPv4-specific code in the mountlist_del_all() path with code
that is address family agnostic.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 utils/mountd/mountd.c |    2 +-
 utils/mountd/mountd.h |    2 +-
 utils/mountd/rmtab.c  |   12 +++++-------
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
index 19dc4ee..98b396d 100644
--- a/utils/mountd/mountd.c
+++ b/utils/mountd/mountd.c
@@ -275,7 +275,7 @@ mount_umntall_1_svc(struct svc_req *rqstp, void *UNUSED(argp),
 	/* Reload /etc/xtab if necessary */
 	auth_reload();
 
-	mountlist_del_all(nfs_getrpccaller_in(rqstp->rq_xprt));
+	mountlist_del_all(nfs_getrpccaller(rqstp->rq_xprt));
 	return 1;
 }
 
diff --git a/utils/mountd/mountd.h b/utils/mountd/mountd.h
index 96e9bf1..0d31ca7 100644
--- a/utils/mountd/mountd.h
+++ b/utils/mountd/mountd.h
@@ -48,7 +48,7 @@ void		auth_export(nfs_export *exp);
 
 void		mountlist_add(char *host, const char *path);
 void		mountlist_del(char *host, const char *path);
-void		mountlist_del_all(struct sockaddr_in *sin);
+void		mountlist_del_all(const struct sockaddr *sap);
 mountlist	mountlist_list(void);
 
 
diff --git a/utils/mountd/rmtab.c b/utils/mountd/rmtab.c
index d23712b..b2c04e7 100644
--- a/utils/mountd/rmtab.c
+++ b/utils/mountd/rmtab.c
@@ -131,21 +131,20 @@ mountlist_del(char *hname, const char *path)
 }
 
 void
-mountlist_del_all(struct sockaddr_in *sin)
+mountlist_del_all(const struct sockaddr *sap)
 {
 	char		*hostname;
 	struct rmtabent	*rep;
-	nfs_export	*exp;
 	FILE		*fp;
 	int		lockid;
 
 	if ((lockid = xflock(_PATH_RMTABLCK, "w")) < 0)
 		return;
-	hostname = host_canonname((struct sockaddr *)sin);
+	hostname = host_canonname(sap);
 	if (hostname == NULL) {
-		char buf[INET_ADDRSTRLEN];
+		char buf[INET6_ADDRSTRLEN];
 		xlog(L_ERROR, "can't get hostname of %s",
-			host_ntop((struct sockaddr *)sin, buf, sizeof(buf)));
+			host_ntop(sap, buf, sizeof(buf)));
 		goto out_unlock;
 	}
 
@@ -157,8 +156,7 @@ mountlist_del_all(struct sockaddr_in *sin)
 
 	while ((rep = getrmtabent(1, NULL)) != NULL) {
 		if (strcmp(rep->r_client, hostname) == 0 &&
-		    (exp = auth_authenticate("umountall",
-				(struct sockaddr *)sin, rep->r_path)))
+		    auth_authenticate("umountall", sap, rep->r_path) != NULL)
 			continue;
 		fputrmtabent(fp, rep, NULL);
 	}


  parent reply	other threads:[~2010-09-13 17:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-13 17:20 [PATCH 00/12] Next series of mountd IPv6 support patches Chuck Lever
2010-09-13 17:20 ` [PATCH 01/12] libnfs.a: Fix API for getfh() & friends Chuck Lever
2010-09-13 17:21 ` [PATCH 02/12] mountd: add IPv6 support in auth_authenticate() Chuck Lever
2010-09-13 17:21 ` [PATCH 03/12] mountd: Support IPv6 in mountd's svc routines Chuck Lever
2010-09-13 17:21 ` Chuck Lever [this message]
2010-09-13 17:21 ` [PATCH 05/12] mountd: Add mountlist_freeall() Chuck Lever
2010-09-13 17:22 ` [PATCH 06/12] mountd: Handle memory exhaustion in mountlist_list() Chuck Lever
2010-09-13 17:22 ` [PATCH 07/12] mountd: Support IPv6 " Chuck Lever
2010-09-13 17:22 ` [PATCH 08/12] exportfs: Enable IPv6 support in matchhostname() Chuck Lever
2010-09-13 17:22 ` [PATCH 09/12] mountd: clean up cache API Chuck Lever
2010-09-13 17:22 ` [PATCH 10/12] mountd: Handle IPv6 addresses in kernel auth_unix_ip upcalls Chuck Lever
2010-09-13 17:22 ` [PATCH 11/12] mountd: Ensure cache downcall can handle IPv6 addresses Chuck Lever
2010-09-13 17:23 ` [PATCH 12/12] libexport.a: Enable IPv6 support in hostname.c Chuck Lever
     [not found] ` <20100913171844.19017.13446.stgit-x+BlCsqV7M/wdl/1UfZZQIVfYA8g3rJ/@public.gmane.org>
2010-09-16 21:29   ` [PATCH 00/12] Next series of mountd IPv6 support patches Steve Dickson

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=20100913172128.19017.28249.stgit@seurat.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.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