diff options
author | Phil Davis <phil.davis@inf.org> | 2016-12-22 17:42:14 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2016-12-22 17:42:14 +0545 |
commit | 0f2cf2a1c47192e8394cbcec6ee291b7e753ac4b (patch) | |
tree | dcb4e221b353b2eecbb3d760f1684342857ebf40 /src/usr/local/www/vpn_openvpn_server.php | |
parent | 1c937bdc57b4a0d476e3ecc80b546b2af02f0559 (diff) | |
download | pfsense-0f2cf2a1c47192e8394cbcec6ee291b7e753ac4b.zip pfsense-0f2cf2a1c47192e8394cbcec6ee291b7e753ac4b.tar.gz |
Fix #7031 Allow interfaces that use DHCP for OpenVPN
even though the interface (or gateway group) has not yet actually
received an IP address.
This is useful when setting up a new system that is currently offline.
Diffstat (limited to 'src/usr/local/www/vpn_openvpn_server.php')
-rw-r--r-- | src/usr/local/www/vpn_openvpn_server.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/usr/local/www/vpn_openvpn_server.php b/src/usr/local/www/vpn_openvpn_server.php index 81861b1..daa85c0 100644 --- a/src/usr/local/www/vpn_openvpn_server.php +++ b/src/usr/local/www/vpn_openvpn_server.php @@ -257,9 +257,17 @@ if ($_POST) { } elseif (is_ipaddrv6($iv_ip) && (stristr($pconfig['protocol'], "6") === false)) { $input_errors[] = gettext("Protocol and IP address families do not match. An IPv4 protocol and an IPv6 IP address cannot be selected."); } elseif ((stristr($pconfig['protocol'], "6") === false) && !get_interface_ip($iv_iface) && ($pconfig['interface'] != "any")) { - $input_errors[] = gettext("An IPv4 protocol was selected, but the selected interface has no IPv4 address."); + // If an underlying interface to be used by this server uses DHCP, then it may not have received an IP address yet. + // So in that case we do not report a problem. + if (!interface_has_dhcp($iv_iface, 4)) { + $input_errors[] = gettext("An IPv4 protocol was selected, but the selected interface has no IPv4 address."); + } } elseif ((stristr($pconfig['protocol'], "6") !== false) && !get_interface_ipv6($iv_iface) && ($pconfig['interface'] != "any")) { - $input_errors[] = gettext("An IPv6 protocol was selected, but the selected interface has no IPv6 address."); + // If an underlying interface to be used by this server uses DHCP6, then it may not have received an IP address yet. + // So in that case we do not report a problem. + if (!interface_has_dhcp($iv_iface, 6)) { + $input_errors[] = gettext("An IPv6 protocol was selected, but the selected interface has no IPv6 address."); + } } if ($pconfig['mode'] != "p2p_shared_key") { |