Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jul 2002 17:50:08 -0700
From:      Bakul Shah <bakul@bitblocks.com>
To:        current@freebsd.org
Subject:   mount_nfs -T breakage
Message-ID:  <200207250050.UAA20544@wellington.cnchost.com>

next in thread | raw e-mail | index | archive | help
TCP mount of nfs seems to be broken.

# mount bar:/usr /mnt
[tcp] bar:/usr: RPCPROG_NFS: RPC: Unknown protocol

I tracked this down to lib/libc/rpc/rpcb_clnt.c.  Seems like
the problem is in __rpcb_findaddr_timed().

diff -r 1.9 rpcb_clnt.c 
--- rpcb_clnt.c 22 Mar 2002 23:18:37 -0000      1.9
+++ rpcb_clnt.c 11 Jul 2002 16:23:04 -0000      1.10
...[deleted]...
@@ -672,13 +731,15 @@
  * starts working properly.  Also look under clnt_vc.c.
  */
 struct netbuf *
-__rpcb_findaddr(program, version, nconf, host, clpp)
+__rpcb_findaddr_timed(program, version, nconf, host, clpp, tp)
        rpcprog_t program;
...[deleted]...
@@ -710,22 +777,31 @@
                 */
                if (strcmp(nconf->nc_proto, NC_TCP) == 0) {
                        struct netconfig *newnconf;
+                       void *handle;
 
-                       if ((newnconf = getnetconfigent("udp")) == NULL) {
+                       if ((handle = getnetconfigent("udp")) == NULL) {
+                               rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
+                               return (NULL);
+                       }
+                       if ((newnconf = __rpc_getconf(handle)) == NULL) {
+                               __rpc_endconf(handle);
                                rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
                                return (NULL);
                        }
                        client = getclnthandle(host, newnconf, &parms.r_addr);
-                       freenetconfigent(newnconf);
+                       __rpc_endconf(handle);
                } else {
                        client = getclnthandle(host, nconf, &parms.r_addr);

Notice how newnconf, the second arg of getclnthandle(), is
derived.  Previously it was the output of getnetconfigent()
while now it is output of __rpc_getconf().  It expects its
arg to be of type ``struct handle*'', but it is given an arg
of type ``struct netconfig*''  The two structs are not congruent.

I don't really understand this code so I don't know what the real
fix is.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207250050.UAA20544>