pfsense/pfsense — pull request #917 by phil-davis (2014-02-14 12:12:56+00:00)
Title: Enhanced validation of general DNS servers and gateways

I had a few external issues with DNS servers today, so was making changes to work around unavailable external DNS servers. In doing that I noticed that routes to old DNS servers through the old selected gateway were getting left behind in the routing table - confusing the issues I already had with DNS servers! So I have fixed up this code:
In System, General Setup, you could blank one of the DNS server boxes, but leave a gateway selected and it would happily save that. Now you get a validation error.
When removing or changing DNS servers and the corresponding gateway, the route through the previous gateway was not being removed. (e.g. if you changed from a selected gateway to gateway none, or if you kept the gateway selected but changed the DNS server address, or if you changed both at once, or if you blanked out the DNS server and changed the gateway to none or...).
Now the code removes the old route, so old routes to old DNS servers are not left in the routing table.
I have tested on 2.1.1-prerelease - system.php is the same in 2.1 branch and master, so this code will fix things in both.