diff --git a/net/l2tp/src/www/vpn_l2tp.php b/net/l2tp/src/www/vpn_l2tp.php index 571cd0e03..9c1ece30c 100644 --- a/net/l2tp/src/www/vpn_l2tp.php +++ b/net/l2tp/src/www/vpn_l2tp.php @@ -53,7 +53,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['paporchap'] = $l2tpcfg['paporchap']; $pconfig['secret'] = $l2tpcfg['secret']; } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { - unset($input_errors); $pconfig = $_POST; /* input validation */ @@ -225,7 +224,7 @@ include("head.inc"); - + - diff --git a/net/pptp/Makefile b/net/pptp/Makefile index cd1e45bbd..116eabb3c 100644 --- a/net/pptp/Makefile +++ b/net/pptp/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= pptp -PLUGIN_VERSION= 1.7 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.8 PLUGIN_DEPENDS= clog mpd5 PLUGIN_COMMENT= PPTP server based on MPD5 PLUGIN_MAINTAINER= franco@opnsense.org diff --git a/net/pptp/src/etc/inc/plugins.inc.d/if_pptp.inc b/net/pptp/src/etc/inc/plugins.inc.d/if_pptp.inc index 6c01ec5ed..e7dd0331d 100644 --- a/net/pptp/src/etc/inc/plugins.inc.d/if_pptp.inc +++ b/net/pptp/src/etc/inc/plugins.inc.d/if_pptp.inc @@ -1,7 +1,7 @@ + * Coypright (C) 2016-2018 Franco Fichtner * Copyright (C) 2008 Shrew Soft Inc. * Copyright (C) 2008 Ermal Luçi * Copyright (C) 2004 Scott Ullrich @@ -127,6 +127,8 @@ function if_pptp_configure_do() return 1; } + $selfip = get_interface_ip($pptpdcfg['interface']); + $iprange = $pptpdcfg['remoteip'] . ' '; $iprange .= long2ip32(ip2long($pptpdcfg['remoteip']) + $pptpdcfg['n_pptp_units'] - 1); @@ -158,7 +160,7 @@ EOD; } $mpdconf .= "\n"; } elseif (isset($config['dnsmasq']['enable']) || isset($config['unbound']['enable'])) { - $mpdconf .= " set ipcp dns " . get_interface_ip("lan"); + $mpdconf .= " set ipcp dns {$selfip}"; if (isset($syscfg['dnsserver'][0])) { $mpdconf .= " " . $syscfg['dnsserver'][0]; } @@ -195,7 +197,7 @@ EOD; set link enable chap-msv2 set link mtu 1460 set link keep-alive 10 60 - set pptp self {$pptpdcfg['localip']} + set pptp self {$selfip} set link enable incoming EOD; diff --git a/net/pptp/src/www/vpn_pptp.php b/net/pptp/src/www/vpn_pptp.php index 243f997be..8e347292c 100644 --- a/net/pptp/src/www/vpn_pptp.php +++ b/net/pptp/src/www/vpn_pptp.php @@ -1,31 +1,31 @@ - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ + * Copyright (C) 2014-2016 Deciso B.V. + * Copyright (C) 2003-2005 Manuel Kasper + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ require_once('guiconfig.inc'); require_once('interfaces.inc'); @@ -43,6 +43,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['wins'] = $pptpcfg['wins']; $pconfig['req128'] = isset($pptpcfg['req128']); $pconfig['n_pptp_units'] = $pptpcfg['n_pptp_units']; + $pconfig['interface'] = $pptpcfg['interface']; $pconfig['pptp_dns1'] = $pptpcfg['dns1']; $pconfig['pptp_dns2'] = $pptpcfg['dns2']; $pconfig['radiusenable'] = isset($pptpcfg['radius']['server']['enable']); @@ -60,9 +61,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['radius_acct_update'] = $pptpcfg['radius']['acct_update']; $pconfig['radius_nasip'] = $pptpcfg['radius']['nasip']; } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { - if (isset($input_errors) && count($input_errors) > 0) { - unset($input_errors); - } $pconfig = $_POST; /* input validation */ @@ -107,6 +105,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pptpcfg['remoteip'] = $_POST['remoteip']; $pptpcfg['localip'] = $_POST['localip']; $pptpcfg['mode'] = $_POST['mode']; + $pptpcfg['interface'] = $_POST['interface']; $pptpcfg['wins'] = $_POST['wins']; $pptpcfg['n_pptp_units'] = $_POST['n_pptp_units']; $pptpcfg['radius']['server']['ip'] = $_POST['radiusserver']; @@ -213,24 +212,15 @@ include("head.inc"); - + - + $ifacename): ?> + + - @@ -251,6 +241,24 @@ include("head.inc"); + + + + + +