Date: Fri, 17 Jun 2011 16:23:50 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/usr.sbin/rpc.statd statd.c Message-ID: <201106171624.p5HGO5Ng051089@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
rmacklem 2011-06-17 16:23:50 UTC FreeBSD src repository Modified files: (Branch: RELENG_8) usr.sbin/rpc.statd statd.c Log: SVN rev 223191 on 2011-06-17 16:23:50Z by rmacklem MFC: r222627 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. Revision Changes Path 1.19.2.2 +212 -28 src/usr.sbin/rpc.statd/statd.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106171624.p5HGO5Ng051089>