diff options
author | brooks <brooks@FreeBSD.org> | 2008-02-01 23:43:58 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2008-02-01 23:43:58 +0000 |
commit | 9855940fef1a8a457cac30591a65833ec2d45010 (patch) | |
tree | 18253aba5d9c9f6b9d0ae2aa5c70eb814ce67909 /etc/rc.d/dhclient | |
parent | a0c183dcb80ecb1d131bb1af81afd0fcc0cd40d5 (diff) | |
download | FreeBSD-src-9855940fef1a8a457cac30591a65833ec2d45010.zip FreeBSD-src-9855940fef1a8a457cac30591a65833ec2d45010.tar.gz |
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
Diffstat (limited to 'etc/rc.d/dhclient')
-rwxr-xr-x | etc/rc.d/dhclient | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/etc/rc.d/dhclient b/etc/rc.d/dhclient index d182214..890aeaf 100755 --- a/etc/rc.d/dhclient +++ b/etc/rc.d/dhclient @@ -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 |