From owner-freebsd-bugs Sun Aug 25 10:20:12 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E2AE37B400 for ; Sun, 25 Aug 2002 10:20:05 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D65B343E75 for ; Sun, 25 Aug 2002 10:20:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g7PHK2JU030511 for ; Sun, 25 Aug 2002 10:20:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g7PHK2sR030510; Sun, 25 Aug 2002 10:20:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3179037B400 for ; Sun, 25 Aug 2002 10:18:05 -0700 (PDT) Received: from imag.imag.fr (imag.imag.fr [129.88.30.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 32F9D43E3B for ; Sun, 25 Aug 2002 10:18:03 -0700 (PDT) (envelope-from Jean-Luc.Richier@imag.fr) Received: from horus.imag.fr (horus.imag.fr [129.88.38.1]) by imag.imag.fr (8.11.6/8.11.6) with ESMTP id g7PHI1v24468 for ; Sun, 25 Aug 2002 19:18:01 +0200 (MEST) Received: (from richier@localhost) by horus.imag.fr (8.11.6/8.11.6/Imag.pm.V2) id g7PHI1s09466 for FreeBSD-gnats-submit@freebsd.org; Sun, 25 Aug 2002 19:18:01 +0200 (MEST) Received: from imag.imag.fr (imag.imag.fr [129.88.30.1]) by horus.imag.fr (8.11.6/8.11.6/Imag.pm.V2) with ESMTP id g7PH81q09201 for ; Sun, 25 Aug 2002 19:08:01 +0200 (MEST) Received: from lagavulin.imag.fr (lagavulin.imag.fr [129.88.23.10]) by imag.imag.fr (8.11.6/8.11.6) with ESMTP id g7PH80v24216 for ; Sun, 25 Aug 2002 19:08:00 +0200 (MEST) Received: from lagavulin.imag.fr (localhost [127.0.0.1]) by lagavulin.imag.fr (8.12.5/8.12.5) with ESMTP id g7PH6j7B009258; Sun, 25 Aug 2002 19:06:45 +0200 (MEST) (envelope-from richier@horus.imag.fr) Received: (from root@localhost) by lagavulin.imag.fr (8.12.5/8.12.5/Submit) id g7PH6iXC009257; Sun, 25 Aug 2002 19:06:44 +0200 (MEST) (envelope-from richier) Message-Id: <200208251706.g7PH6iXC009257@lagavulin.imag.fr> Date: Sun, 25 Aug 2002 19:06:44 +0200 (MEST) From: Jean-Luc Richier Reply-To: Jean-Luc Richier To: FreeBSD-gnats-submit@FreeBSD.org Cc: Jean-Luc.Richier@imag.fr X-Send-Pr-Version: 3.113 Subject: bin/42003: mount_nfs in UDP mode does not respect -c option and may fail Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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