Unreliable Wifi on Cyanogenmod I installed Cyanogenmod 11 on an HTC One. There are a few quirks, but mostly everything works. The only real annoying thing is wireless doesn't work reliably.

I have a Netgear N900 wireless router running DD-WRT, and the phone can connect to it, but after a few minutes of inactivity on my phone, the wireless just stops and Cyanogenmod shows the connection as "Saved, secured with WPA2" but I'm unable to bring anything up over wifi. Clicking the wifi point and selecting "Connect to network" does nothing. The only workaround I found is to disable and then re-enable my wifi, and then it automatically reconnects and wifi works.

I confirmed I have "keep wifi active when idle" checked in my settings.

Is this a bug in CM, or do I have something misconfigured? How can I fix it?

Edit: As a workaround, I found the problem disappears if I configure the DD-WRT router to N-only instead of the default auto/mixed mode. I'm still unsure if there's a bug in CM that prevents it from working with the router in auto mode, of if DD-WRT has a bug in it that causes devices to disconnect.
The behaviour you describe could plausibly be caused by a bug in the Wi-Fi software on your phone, if sleeping the Wi-Fi transceiver makes it forget something necessary to make the connection work (such as the WPA keys).

This is the kind of thing you have to expect when you use a pre-release version of a ROM. Nightly builds simply aren't suitable for day-to-day use, because it's a bit of a lottery what bugs will have been added from one build to the next. Switch to a stable build instead.