Daily Kos favicon

The US has a long history of changing voting districts for political reasons. Is it legal?