From owner-cvs-src-old@FreeBSD.ORG Fri Jun 24 20:15:52 2011 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AC331065771 for ; Fri, 24 Jun 2011 20:15:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3698FC15 for ; Fri, 24 Jun 2011 20:15:51 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.4/8.14.4) with ESMTP id p5OKFppk057723 for ; Fri, 24 Jun 2011 20:15:51 GMT (envelope-from rmacklem@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.4/8.14.4/Submit) id p5OKFpWk057722 for cvs-src-old@freebsd.org; Fri, 24 Jun 2011 20:15:51 GMT (envelope-from rmacklem@repoman.freebsd.org) Message-Id: <201106242015.p5OKFpWk057722@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to rmacklem@repoman.freebsd.org using -f From: Rick Macklem Date: Fri, 24 Jun 2011 20:15:44 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: RELENG_8 Subject: cvs commit: src/usr.sbin/mountd mountd.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2011 20:15:52 -0000 rmacklem 2011-06-24 20:15:44 UTC FreeBSD src repository Modified files: (Branch: RELENG_8) usr.sbin/mountd mountd.c Log: SVN rev 223516 on 2011-06-24 20:15:44Z by rmacklem MFC: r216587, r222623 Fix the nfs related daemons so that they don't intermittently fail with "bind: address already in use". This problem was reported to the freebsd-stable@ mailing list on Feb. 19 under the subject heading "statd/lockd startup failure" by george+freebsd at m5p dot com. The problem is that the first combination of {udp,tcp X ipv4,ipv6} would select a port# dynamically, but one of the other three combinations would have that port# already in use. The patch is somewhat involved because it was requested by dougb@ that the four combinations use the same port# wherever possible. The patch splits the create_service() function into two functions. The first goes as far as bind(2) in a loop for up to GETPORT_MAXTRY - 1 times, attempting to use the same port# for all four cases. If these attempts fail, the last attempt allows the 4 cases to use different port #s. After this function has succeeded, the second function, called complete_service(), does the rest of what create_service() did. The three daemons mountd, rpc.lockd and rpc.statd all have a create_service() function that is patched in a similar way. However, create_service() has non-trivial differences for the three daemons that made it impractical to share the same functions between them. Also MFC'd r216587 so that r222623 would merge cleanly and mountd.c would be up to date. Revision Changes Path 1.105.2.4 +261 -141 src/usr.sbin/mountd/mountd.c