pfsense/pfsense — pull request #883 by phil-davis (2014-01-09 14:50:31+00:00)
Title: Return GWG protocol when no gateway IP

Forum: http://forum.pfsense.org/index.php/topic,71142.0.html
When no gateway in a group has a gateway IP address yet, the bit of code here was not executed and thus the 'ipprotocol' is never set/returned for the gateway group, even though determining the IP protocol is easily done without actually having the gateway IP known.
This fixes that behaviour with minimal code change, to avoid possible impact on other callers of this fairly complex function. This fixes validation of policy-route firewall rules to a GWG that currently has no known gateway IPs (e.g. the forum poster has 2 WAN DHCP with the cables not yet connected).
return_gateway_groups_array() can now return the GWG IP protocol and also have all member gateways down. I think this will be of benefit to other callers, and not have a negative impact. But those more familiar with all the uses of this function should think about any other side-effects this may have before committing:)
This could usefully be back-ported to 2.1 branch also.