Date: Sun, 25 Aug 2002 19:06:44 +0200 (MEST) From: Jean-Luc Richier <Jean-Luc.Richier@imag.fr> To: FreeBSD-gnats-submit@FreeBSD.org Cc: Jean-Luc.Richier@imag.fr Subject: bin/42003: mount_nfs in UDP mode does not respect -c option and may fail Message-ID: <200208251706.g7PH6iXC009257@lagavulin.imag.fr>
next in thread | raw e-mail | index | archive | help
>Number: 42003 >Category: bin >Synopsis: mount_nfs in UDP mode does not respect -c option and may fail >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Aug 25 10:20:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Jean-Luc Richier >Release: FreeBSD 5.0-CURRENT i386 >Organization: LSR-IMAG, Grenoble, France >Environment: System: FreeBSD lagavulin.imag.fr 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Thu Aug 22 09:43:42 MEST 2002 richier@lagavulin.imag.fr:/altroot1a/usr/obj/usr/src/sys/GENERIC i386 >Description: mount_nfs does not respect the NFSMNT_NOCONN mount option. Therefore in some case cases mount_nfs will fails to make a mount even tough the kernel shoule accept accesses >How-To-Repeat: Consider 2 machines, A with 2 interfaces and addresses A1 and A2, and B on the same cable as A1. If one does on B 'mount_nfs A2:/xxx /mnt', mount_nfs will not respond and do a time out, as mount_nfs wait for responses coming fro A1 address. That is why there is a -c (NFSMNT_NOCONN) option, to accept answers coming from any address. However the NFSMNT_NOCONN is correctly treated in the kernel, but mount_nfs begins its code with a rpcping which does not respect the option. Therefore mount_nfs times out before the mount call . >Fix: Test the NFSMNT_NOCONN option in the rpcping code and `Use connect(), to match what the kernel does' only if this flag is off --- sbin/mount_nfs/mount_nfs.c.1.53 Wed Aug 7 00:54:26 2002 +++ sbin/mount_nfs/mount_nfs.c Sun Aug 25 18:23:09 2002 @@ -660,7 +660,8 @@ return (returncode(rpc_createerr.cf_stat, &rpc_createerr.cf_error)); } - if (nfsargsp->sotype == SOCK_DGRAM) { + if (nfsargsp->sotype == SOCK_DGRAM && + !(nfsargsp->flags & NFSMNT_NOCONN)) { /* * Use connect(), to match what the kernel does. This * catches cases where the server responds from the >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208251706.g7PH6iXC009257>