summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-06-07 11:53:58 -0400
committerjim-p <jimp@pfsense.org>2010-06-07 11:54:42 -0400
commit09f2bf85e6fecdb88195d35271d62c9bc5ff4637 (patch)
treee0e7f55458e112687b082d769944aec3c79828d3 /etc
parent692730bf32b6658bee626c2bb58ffce54b7bcb14 (diff)
downloadpfsense-09f2bf85e6fecdb88195d35271d62c9bc5ff4637.zip
pfsense-09f2bf85e6fecdb88195d35271d62c9bc5ff4637.tar.gz
Honor GUI configured DNS settings for PPTP/PPPoE/L2TP if present.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/vpn.inc50
1 files changed, 30 insertions, 20 deletions
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc
index f38a0ff..a98969d 100644
--- a/etc/inc/vpn.inc
+++ b/etc/inc/vpn.inc
@@ -1065,18 +1065,20 @@ EOD;
if (isset($pptpdcfg["wins"]) && $pptpdcfg['wins'] != "")
$mpdconf .= " set ipcp nbns {$pptpdcfg['wins']}\n";
- if (is_array($pptpdcfg['dnsserver']) && ($pptpdcfg['dnsserver'][0])) {
- $mpdconf .= " set ipcp dns " . join(" ", $pptpdcfg['dnsserver']) . "\n";
- } else
- if (isset ($config['dnsmasq']['enable'])) {
- $mpdconf .= " set ipcp dns " . get_interface_ip("lan");
- if ($syscfg['dnsserver'][0])
- $mpdconf .= " " . $syscfg['dnsserver'][0];
- $mpdconf .= "\n";
- } else
- if (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
- $mpdconf .= " set ipcp dns " . join(" ", $syscfg['dnsserver']) . "\n";
- }
+
+ if (!empty($pptpdcfg['dns1'])) {
+ $mpdconf .= " set ipcp dns " . $pptpdcfg['dns1'];
+ if (!empty($pptpdcfg['dns2']))
+ $mpdconf .= " " . $pptpdcfg['dns2'];
+ $mpdconf .= "\n";
+ } elseif (isset ($config['dnsmasq']['enable'])) {
+ $mpdconf .= " set ipcp dns " . get_interface_ip("lan");
+ if ($syscfg['dnsserver'][0])
+ $mpdconf .= " " . $syscfg['dnsserver'][0];
+ $mpdconf .= "\n";
+ } elseif (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
+ $mpdconf .= " set ipcp dns " . join(" ", $syscfg['dnsserver']) . "\n";
+ }
if (isset ($pptpdcfg['radius']['server']['enable'])) {
$authport = (isset($pptpdcfg['radius']['server']['port']) && strlen($pptpdcfg['radius']['server']['port']) > 1) ? $pptpdcfg['radius']['server']['port'] : 1812;
@@ -1274,15 +1276,19 @@ pppoe_standart:
EOD;
- if (isset ($config['dnsmasq']['enable'])) {
+ if (!empty($pppoecfg['dns1'])) {
+ $mpdconf .= " set ipcp dns " . $pppoecfg['dns1'];
+ if (!empty($pppoecfg['dns2']))
+ $mpdconf .= " " . $pppoecfg['dns2'];
+ $mpdconf .= "\n";
+ } elseif (isset ($config['dnsmasq']['enable'])) {
$mpdconf .= " set ipcp dns " . get_interface_ip("lan");
if ($syscfg['dnsserver'][0])
$mpdconf .= " " . $syscfg['dnsserver'][0];
$mpdconf .= "\n";
- } else
- if (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
+ } elseif (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
$mpdconf .= " set ipcp dns " . join(" ", $syscfg['dnsserver']) . "\n";
- }
+ }
if (isset ($pppoecfg['radius']['enable'])) {
$mpdconf .=<<<EOD
@@ -1454,15 +1460,19 @@ l2tp_standard:
EOD;
- if (isset ($config['dnsmasq']['enable'])) {
+ if (!empty($l2tpcfg['dns1'])) {
+ $mpdconf .= " set ipcp dns " . $l2tpcfg['dns1'];
+ if (!empty($l2tpcfg['dns2']))
+ $mpdconf .= " " . $l2tpcfg['dns2'];
+ $mpdconf .= "\n";
+ } elseif (isset ($config['dnsmasq']['enable'])) {
$mpdconf .= " set ipcp dns " . get_interface_ip("lan");
if ($syscfg['dnsserver'][0])
$mpdconf .= " " . $syscfg['dnsserver'][0];
$mpdconf .= "\n";
- } else
- if (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
+ } elseif (is_array($syscfg['dnsserver']) && ($syscfg['dnsserver'][0])) {
$mpdconf .= " set ipcp dns " . join(" ", $syscfg['dnsserver']) . "\n";
- }
+ }
if (isset ($l2tpcfg['radius']['enable'])) {
$mpdconf .=<<<EOD
OpenPOWER on IntegriCloud