mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2.6.6pre1 nfs4] portmap register switcher
@ 2004-04-18  0:54 Fabian Frederick
  0 siblings, 0 replies; only message in thread
From: Fabian Frederick @ 2004-04-18  0:54 UTC (permalink / raw)
  To: Trond; +Cc: lkml

[-- Attachment #1: Type: text/plain, Size: 108 bytes --]

Trond,

	Here's a patch to have an svc_makesock portmap switcher (+ lockd & nfs
updated).


Regards,
Fabian

[-- Attachment #2: pmap_reg1.diff --]
[-- Type: text/x-patch, Size: 3456 bytes --]

diff -Naur orig/fs/lockd/svc.c edited/fs/lockd/svc.c
--- orig/fs/lockd/svc.c	2004-04-04 05:37:36.000000000 +0200
+++ edited/fs/lockd/svc.c	2004-04-18 02:32:00.000000000 +0200
@@ -237,9 +237,9 @@
 		goto out;
 	}
 
-	if ((error = svc_makesock(serv, IPPROTO_UDP, nlm_udpport)) < 0 
+	if ((error = svc_makesock(serv, IPPROTO_UDP, nlm_udpport, 1)) < 0 
 #ifdef CONFIG_NFSD_TCP
-	 || (error = svc_makesock(serv, IPPROTO_TCP, nlm_tcpport)) < 0
+	 || (error = svc_makesock(serv, IPPROTO_TCP, nlm_tcpport, 1)) < 0
 #endif
 		) {
 		if (warned++ == 0) 
diff -Naur orig/fs/nfs/callback.c edited/fs/nfs/callback.c
--- orig/fs/nfs/callback.c	2004-04-17 00:38:02.000000000 +0200
+++ edited/fs/nfs/callback.c	2004-04-18 02:30:08.000000000 +0200
@@ -93,8 +93,7 @@
 	ret = -ENOMEM;
 	if (!serv)
 		goto out_err;
-	/* FIXME: We don't want to register this socket with the portmapper */
-	ret = svc_makesock(serv, IPPROTO_TCP, 0);
+	ret = svc_makesock(serv, IPPROTO_TCP, 0, 0);
 	if (ret < 0)
 		goto out_destroy;
 	if (!list_empty(&serv->sv_permsocks)) {
diff -Naur orig/fs/nfsd/nfssvc.c edited/fs/nfsd/nfssvc.c
--- orig/fs/nfsd/nfssvc.c	2004-04-04 05:37:23.000000000 +0200
+++ edited/fs/nfsd/nfssvc.c	2004-04-18 02:37:25.000000000 +0200
@@ -101,12 +101,12 @@
 		nfsd_serv = svc_create(&nfsd_program, NFSD_BUFSIZE);
 		if (nfsd_serv == NULL)
 			goto out;
-		error = svc_makesock(nfsd_serv, IPPROTO_UDP, port);
+		error = svc_makesock(nfsd_serv, IPPROTO_UDP, port, 1);
 		if (error < 0)
 			goto failure;
 
 #ifdef CONFIG_NFSD_TCP
-		error = svc_makesock(nfsd_serv, IPPROTO_TCP, port);
+		error = svc_makesock(nfsd_serv, IPPROTO_TCP, port, 1);
 		if (error < 0)
 			goto failure;
 #endif
diff -Naur orig/include/linux/sunrpc/svcsock.h edited/include/linux/sunrpc/svcsock.h
--- orig/include/linux/sunrpc/svcsock.h	2004-04-04 05:36:53.000000000 +0200
+++ edited/include/linux/sunrpc/svcsock.h	2004-04-18 02:42:49.000000000 +0200
@@ -55,7 +55,7 @@
 /*
  * Function prototypes.
  */
-int		svc_makesock(struct svc_serv *, int, unsigned short);
+int		svc_makesock(struct svc_serv *, int, unsigned short, int);
 void		svc_delete_socket(struct svc_sock *);
 int		svc_recv(struct svc_serv *, struct svc_rqst *, long);
 int		svc_send(struct svc_rqst *);
diff -Naur orig/net/sunrpc/svcsock.c edited/net/sunrpc/svcsock.c
--- orig/net/sunrpc/svcsock.c	2004-04-17 00:37:41.000000000 +0200
+++ edited/net/sunrpc/svcsock.c	2004-04-18 02:42:04.000000000 +0200
@@ -1388,7 +1388,7 @@
  * Create socket for RPC service.
  */
 static int
-svc_create_socket(struct svc_serv *serv, int protocol, struct sockaddr_in *sin)
+svc_create_socket(struct svc_serv *serv, int protocol, struct sockaddr_in *sin, int pmap_register)
 {
 	struct svc_sock	*svsk;
 	struct socket	*sock;
@@ -1424,7 +1424,7 @@
 			goto bummer;
 	}
 
-	if ((svsk = svc_setup_socket(serv, sock, &error, 1)) != NULL)
+	if ((svsk = svc_setup_socket(serv, sock, &error, pmap_register)) != NULL)
 		return 0;
 
 bummer:
@@ -1474,7 +1474,7 @@
  * Make a socket for nfsd and lockd
  */
 int
-svc_makesock(struct svc_serv *serv, int protocol, unsigned short port)
+svc_makesock(struct svc_serv *serv, int protocol, unsigned short port, int pmap_register)
 {
 	struct sockaddr_in	sin;
 
@@ -1482,7 +1482,7 @@
 	sin.sin_family      = AF_INET;
 	sin.sin_addr.s_addr = INADDR_ANY;
 	sin.sin_port        = htons(port);
-	return svc_create_socket(serv, protocol, &sin);
+	return svc_create_socket(serv, protocol, &sin, pmap_register);
 }
 
 /*

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-04-18  0:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-18  0:54 [PATCH 2.6.6pre1 nfs4] portmap register switcher Fabian Frederick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®