When the state of the interface changes rapidly enough (usually due to

rapid wireless association changes in my experience), there is a race
where dhclient is in the process of exiting due to the link going down
when the link coming up causes devd to try and start a new one.  This
results is the link being up, but no dhclient running.

Work around this race by checking a second time after a one second delay
before refusing to start a dhclient instance due to one already being
running.

MFC after:	1 week
This commit is contained in:
Brooks Davis 2008-02-01 23:43:58 +00:00
parent ddc5368476
commit 983daa047f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175879

View File

@ -21,7 +21,11 @@ dhclient_start()
if [ -x /bin/pgrep ]; then
pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"`
if [ -n "$pids" ]; then
exit 0
sleep 1
pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"`
if [ -n "$pids" ]; then
exit 0
fi
fi
fi