Commit b693693f authored by Franco Fichtner's avatar Franco Fichtner

vpn: really attach netgraph to the used interfaces

(cherry picked from commit 404caff1)
parent 2baa0c87
...@@ -90,19 +90,8 @@ function vpn_services() ...@@ -90,19 +90,8 @@ function vpn_services()
return $services; return $services;
} }
function vpn_netgraph_support() { function vpn_pptpd_configure()
$iflist = get_configured_interface_list(); {
foreach ($iflist as $iface) {
$realif = get_real_interface($iface);
/* Get support for netgraph(4) from the nic */
$ifinfo = pfSense_get_interface_addresses($realif);
if (!empty($ifinfo) && in_array($ifinfo['iftype'], array("ether", "vlan", "bridge"))) {
pfSense_ngctl_attach(".", $realif);
}
}
}
function vpn_pptpd_configure() {
global $config; global $config;
$syscfg = $config['system']; $syscfg = $config['system'];
...@@ -307,9 +296,9 @@ EOD; ...@@ -307,9 +296,9 @@ EOD;
unset($mpdsecret); unset($mpdsecret);
chmod('/var/etc/pptp-vpn/mpd.secret', 0600); chmod('/var/etc/pptp-vpn/mpd.secret', 0600);
vpn_netgraph_support(); /* fixed to WAN elsewhere, no need to extend, but at least make it work */
pfSense_ngctl_attach('.', get_real_interface('wan'));
/* fire up mpd */
mwexec('/usr/local/sbin/mpd4 -b -d /var/etc/pptp-vpn -p /var/run/pptp-vpn.pid -s pptps pptps'); mwexec('/usr/local/sbin/mpd4 -b -d /var/etc/pptp-vpn -p /var/run/pptp-vpn.pid -s pptps pptps');
break; break;
...@@ -553,12 +542,10 @@ EOD; ...@@ -553,12 +542,10 @@ EOD;
chmod("/var/etc/pppoe{$pppoecfg['pppoeid']}-vpn/mpd.secret", 0600); chmod("/var/etc/pppoe{$pppoecfg['pppoeid']}-vpn/mpd.secret", 0600);
} }
/* Check if previous instance is still up */
killbypid("/var/run/pppoe{$pppoecfg['pppoeid']}-vpn.pid"); killbypid("/var/run/pppoe{$pppoecfg['pppoeid']}-vpn.pid");
/* Get support for netgraph(4) from the nic */
pfSense_ngctl_attach(".", $pppoe_interface); pfSense_ngctl_attach(".", $pppoe_interface);
/* fire up mpd */
mwexec("/usr/local/sbin/mpd4 -b -d /var/etc/pppoe{$pppoecfg['pppoeid']}-vpn -p /var/run/pppoe{$pppoecfg['pppoeid']}-vpn.pid -s poes poes"); mwexec("/usr/local/sbin/mpd4 -b -d /var/etc/pppoe{$pppoecfg['pppoeid']}-vpn -p /var/run/pppoe{$pppoecfg['pppoeid']}-vpn.pid -s poes poes");
break; break;
...@@ -747,9 +734,8 @@ EOD; ...@@ -747,9 +734,8 @@ EOD;
unset($mpdsecret); unset($mpdsecret);
chmod('/var/etc/l2tp-vpn/mpd.secret', 0600); chmod('/var/etc/l2tp-vpn/mpd.secret', 0600);
vpn_netgraph_support(); pfSense_ngctl_attach('.', get_real_interface($l2tpcfg['interface']));
/* fire up mpd */
mwexec('/usr/local/sbin/mpd4 -b -d /var/etc/l2tp-vpn -p /var/run/l2tp-vpn.pid -s l2tps l2tps'); mwexec('/usr/local/sbin/mpd4 -b -d /var/etc/l2tp-vpn -p /var/run/l2tp-vpn.pid -s l2tps l2tps');
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment