I've seen this posted and I also read that for some it doesn't work but, on my 2-days old iPhone 4, wich came with iOS 4.1, when updated to 4.2.1 I started having WiFi issues, it would connect to the wireless router, was able to access the internet but, when it went to sleep/lock mode either by itself or when I pressed the button, if I "woke" up the phone the WiFi icon would still be there, the IP was still active, it was registered on the router as an active device but it wasn't able to establish an internet connection unless I shutdown wifi on the iPhone and turn it back on.
I found this solution yesterday.
I saw a post somewhere in another forum by an iPhone 4 user that simply reset the network settings on the settings->general->reset menu, the device rebooted by itself and everything was normal from then on. I tried it and it also worked for me.
Don't know if it works on 3g/3gs.
Cheers,
John
edit: wrong menu... what a n00b :-S
Message was edited by: JohnDV