Endless “Obtaining IP Address” loop Possible duplicates:

https://android.stackexchange.com/questions/60139/ice-cream-sandwich-cant-obtain-ip-address-what-do-i-need-to-delete-to-reset-wi
Device stuck on &quot;obtaining IP address&quot;, then sets network to &quot;disabled&quot;


I have a Sony Ericcson Mini Pro (Codename “Mango” at CyanogenMod) with CyanogenMod 9.1.0-mango. This is Android 4.0.4.
The problem
When trying to connect to a wireless network, it will be stuck in an “Optaining IP Address” loop for a while, until it shows “Bad Connection”. This is what it looks like in the wireless network system settings:

My tablet with CyanogenMod 10.2, Android 4.3, can connect to that wireless network without any problems, so can my Kubuntu 13.10 laptop with an Intel wireless card.
Tried so far
While looking for the cause and a fix for the problem, I found numerous posts that suggest to use a static IP address. This is a legitamate workaround, and I might resort to that, but I would like to fix this in general.

The first thing I tried was to change permissions of /system/etc/dhcpcd/dhcpcd-run-hooks to 555. This did not have any effect, though.

Then I downloaded the WiFix app and ran it in automatic mode. Did not do anything either.

Last thing I tried was deleting /data/misc/dhcp/*. No effect at all.

Update 2014-02-21: As you can see in the screenshot, the signal strength is really weak, although the phone is one meter apart from the router with a desk in between. Now it connected while being on the table. The signal strength is full now. I read in a different question that the issue might be caused by a weak signal. Could that the be underlying issue?
My router does not have an external antenna, therefore, it might be a little unpredictable where the signal is strongest. I set the phone onto the router, and it still had the problem. So signal strength should not be the issue.

Update 2014-03-04: I installed the latest nightly build of Cyanogen Mod on the device using their instructions. This installed Android 4.1.3, which had a severe problem with the wireless. It was turned off when I started the device, and it got stuck at activating wifi. So I reverted to the latest stable version which still has this endless loop.

Update 2014-03-04: For my home network, I set up a static IP address, although I really do not like it. However, the internet connection works now.

Update 2014-03-06: Checked for /system/bin/sh -&gt; mksh, and it is present. This does not seem to cause the issue.


How could I fix this apparent DHCP issue?
I had the same symptoms while cooking a ROM when the symlink of /system/bin/sh to mksh was missing.