I also have a Galaxy S2 with WiFi problems. 9100M with ICS. The phone itself would connect to network no problem, but there would be no data transfer. You can still see signal strength and connected messages.
And to me it seems to be IP addresses' problem. The all the IPs(IPv4, Gateway) for this phone are all wrong(or it should be wrong). And the Mac and IP address for my phone doesn't match the addresses' that is connected and displayed on my router. I changed from DHCP to static and manually typed out the IPs and it disconnect from the network.
The router seem to have a Android device connected to it, but the MAC and IPv4 addresses are different from my device.
None of the apps that require Internet have access to Internet when it says it's connected to a network. So it's not just the web browser problem. This happened very recently. Never had this problem before.
Try to restart/power on/off the router. See if that fixes it. I don't know if there's any apps that get's you a new set of IPs for your phone. Now my Wifi is working.