NetBSD Problem Report #480

From gnats  Fri Sep 16 21:20:44 1994
Received: from excalibur.entropic.com (root@excalibur.entropic.com [192.86.164.105]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with ESMTP id VAA08919 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Fri, 16 Sep 1994 21:20:28 -0700
Message-Id: <199409170421.AAA00863@excalibur.entropic.com>
Date: Sat, 17 Sep 1994 00:21:56 -0400
From: kenh@entropic.com
Reply-To: kenh@entropic.com
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: Cannot mount NFS filesystem from hosts that only support NFS/TCP
X-Send-Pr-Version: 3.2

>Number:         480
>Category:       bin
>Synopsis:       Cannot mount NFS filesystem from hosts that only support NFS/TCP
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 16 21:35:03 +0000 1994
>Closed-Date:    Sat Sep 17 05:29:05 +0000 1994
>Last-Modified:  Tue May 27 02:38:00 +0000 2003
>Originator:     Ken Hornstein
>Release:        
>Organization:
"	"
>Environment:

System: NetBSD excalibur 1.0_BETA NetBSD 1.0_BETA (EXCALIBUR) #1: Sun Sep 4 00:05:14 EDT 1994 kenh@excalibur:/usr/src/sys/arch/i386/compile/EXCALIBUR i386


>Description:
Even if you give the -T option to mount_nfs, it still uses UDP to get the
initial filehandle for the mount system call.  This fails if the remote host
only supports NFS/TCP.  Mount_nfs should use the same transport type to get
the initial filehandle as it uses for the mount.

>How-To-Repeat:
mount -t nfs -o rdonly,-T playground.sun.com:/export/home/ftp /mnt

(playground.sun.com is a machine at Sun which exports that filesystem to the
world, but only for NFS/TCP mounts)

>Fix:

This seems to solve the problem, but the code itself is a bit ugly -- but you
get the idea.

--- src/sbin/mount_nfs/mount_nfs.c.old	Fri Sep 16 16:28:01 1994
+++ src/sbin/mount_nfs/mount_nfs.c	Sat Sep 17 00:13:01 1994
@@ -454,15 +454,19 @@
 		saddr.sin_family = AF_INET;
 		saddr.sin_port = htons(PMAPPORT);
 		if ((tport = pmap_getport(&saddr, RPCPROG_NFS,
-		    NFS_VER2, IPPROTO_UDP)) == 0) {
+		    NFS_VER2, nfsargsp->sotype == SOCK_STREAM ? IPPROTO_TCP :
+		    IPPROTO_UDP)) == 0) {
 			if ((opflags & ISBGRND) == 0)
 				clnt_pcreateerror("NFS Portmap");
 		} else {
 			saddr.sin_port = 0;
 			pertry.tv_sec = 10;
 			pertry.tv_usec = 0;
-			if ((clp = clntudp_create(&saddr, RPCPROG_MNT,
-			    RPCMNT_VER1, pertry, &so)) == NULL) {
+			if ((clp = (nfsargsp->sotype == SOCK_STREAM ?
+			    clnttcp_create(&saddr, RPCPROG_MNT, RPCMNT_VER1,
+					   &so, 0, 0) :
+			    clntudp_create(&saddr, RPCPROG_MNT, RPCMNT_VER1,
+					   pertry, &so))) == NULL) {
 				if ((opflags & ISBGRND) == 0)
 					clnt_pcreateerror("Cannot MNT PRC");
 			} else {
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mycroft 
State-Changed-When: Fri Sep 16 22:29:05 PDT 1994 
State-Changed-Why:  
Patch applied. 

From: Jun-ichiro itojun Hagino <itojun@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: pr/480 CVS commit: src/sbin/setkey
Date: Tue, 27 May 2003 02:37:25 +0000 (UTC)

 Module Name:	src
 Committed By:	itojun
 Date:		Tue May 27 02:37:25 UTC 2003

 Modified Files:
 	src/sbin/setkey: setkey.8

 Log Message:
 correct bad RFC ref.  KAME problem report 480


 To generate a diff of this commit:
 cvs rdiff -r1.15 -r1.16 src/sbin/setkey/setkey.8

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.