diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-03-11 20:35:36 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-03-11 20:35:36 +0000 |
commit | 88964924ef148fb3f1ba31f6cef168562956937b (patch) | |
tree | 81fa4baff87a23f2c2596f80b1ba7921d6ce8076 | |
parent | 7a3a352afff32e846207bb56172e1f0df80dc4c0 (diff) | |
download | pfsense-88964924ef148fb3f1ba31f6cef168562956937b.zip pfsense-88964924ef148fb3f1ba31f6cef168562956937b.tar.gz |
Ticket #854 fixes
* Compute the correct amount of ng interface for pptp and pppoe
* Restart mpd processes in one function so that duplicates do not end up in mpd.conf file
-rw-r--r-- | etc/inc/filter.inc | 18 | ||||
-rw-r--r-- | etc/inc/vpn.inc | 17 | ||||
-rwxr-xr-x | etc/rc.bootup | 7 | ||||
-rwxr-xr-x | usr/local/www/vpn_pppoe.php | 2 | ||||
-rwxr-xr-x | usr/local/www/vpn_pppoe_users.php | 2 | ||||
-rwxr-xr-x | usr/local/www/vpn_pppoe_users_edit.php | 2 | ||||
-rwxr-xr-x | usr/local/www/vpn_pptp.php | 2 | ||||
-rwxr-xr-x | usr/local/www/vpn_pptp_users.php | 2 |
8 files changed, 32 insertions, 20 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 26e4328..6310295 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -235,8 +235,22 @@ function filter_generate_aliases() { $aliases .= "# System Aliases \n"; $aliases .= "lan = \"{ {$config['interfaces']['lan']['if']}{$lan_aliases} }\"\n"; $aliases .= "wan = \"{ " . get_real_wan_interface() . "{$wan_aliases} }\"\n"; - $aliases .= "pptp = \"{ ng1 ng2 ng3 ng4 ng5 ng6 ng7 ng8 ng9 ng10 ng11 ng12 ng13 ng14 }\"\n"; - $aliases .= "pppoe = \"{ ng1 ng2 ng3 ng4 ng5 ng6 ng7 ng8 ng9 ng10 ng11 ng12 ng13 ng14 }\"\n"; + + /* build pptp alias */ + $aliases .= "pptp = \"{ "; + for($x=0; $x<$g["n_pptp_units"]; $x++) { + $aliases .= "ng{$x} "; + } + $counter = $x; + $aliases .= "}\" \n"; + + /* build pppoe alias */ + $aliases .= "pppoe = \"{ "; + for($x=0; $x<$g["n_pppoe_units"]; $x++) { + $counter++; + $aliases .= "ng{$counter} "; + } + $aliases .= "}\" \n"; $ifdescrs = array(); for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) { diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc index b52561b..2df79c1 100644 --- a/etc/inc/vpn.inc +++ b/etc/inc/vpn.inc @@ -33,6 +33,15 @@ /* include all configuration functions */ require_once("functions.inc"); +/* master setup for vpn (mpd) */ +function vpn_setup() { + /* start pptpd */ + vpn_pptpd_configure(); + + /* start pppoe server */ + vpn_pppoe_configure(); +} + function vpn_ipsec_failover_configure() { global $config, $g; @@ -836,14 +845,6 @@ function vpn_pppoe_configure() { return 0; echo "Configuring PPPoE VPN service... "; - } else { - /* kill mpd */ - killbypid("{$g['varrun_path']}/mpd-vpn.pid"); - - /* wait for process to die */ - sleep(2); - - vpn_pptpd_configure(); } /* make sure mpd-vpn directory exists */ diff --git a/etc/rc.bootup b/etc/rc.bootup index 94d93c5..7f86de5 100755 --- a/etc/rc.bootup +++ b/etc/rc.bootup @@ -220,11 +220,8 @@ /* start the NTP client */ system_ntp_configure(); - /* start pptpd */ - vpn_pptpd_configure(); - - /* start pppoe server */ - vpn_pppoe_configure(); + /* setup pppoe and pptp */ + vpn_setup(); /* start the captive portal */ captiveportal_configure(); diff --git a/usr/local/www/vpn_pppoe.php b/usr/local/www/vpn_pppoe.php index d50db67..1331b42 100755 --- a/usr/local/www/vpn_pppoe.php +++ b/usr/local/www/vpn_pppoe.php @@ -119,7 +119,7 @@ if ($_POST) { $retval = 0; config_lock(); - $retval = vpn_pppoe_configure(); + $retval = vpn_setup(); config_unlock(); $savemsg = get_std_save_message($retval); diff --git a/usr/local/www/vpn_pppoe_users.php b/usr/local/www/vpn_pppoe_users.php index ddf4379..fb446e3 100755 --- a/usr/local/www/vpn_pppoe_users.php +++ b/usr/local/www/vpn_pppoe_users.php @@ -44,7 +44,7 @@ if ($_POST) { $retval = 0; config_lock(); - $retval = vpn_pppoe_configure(); + $retval = vpn_setup(); config_unlock(); $savemsg = get_std_save_message($retval); diff --git a/usr/local/www/vpn_pppoe_users_edit.php b/usr/local/www/vpn_pppoe_users_edit.php index 9e142b4..3542c18 100755 --- a/usr/local/www/vpn_pppoe_users_edit.php +++ b/usr/local/www/vpn_pppoe_users_edit.php @@ -103,7 +103,7 @@ if ($_POST) { write_config(); config_lock(); - $retval = vpn_pppoe_configure(); + $retval = vpn_setup(); config_unlock(); header("Location: vpn_pppoe_users.php"); diff --git a/usr/local/www/vpn_pptp.php b/usr/local/www/vpn_pptp.php index 33b5e7d..26449e7 100755 --- a/usr/local/www/vpn_pptp.php +++ b/usr/local/www/vpn_pptp.php @@ -127,7 +127,7 @@ if ($_POST) { $retval = 0; config_lock(); - $retval = vpn_pptpd_configure(); + $retval = vpn_setup(); config_unlock(); $savemsg = get_std_save_message($retval); diff --git a/usr/local/www/vpn_pptp_users.php b/usr/local/www/vpn_pptp_users.php index 03dbe8f..b342f0d 100755 --- a/usr/local/www/vpn_pptp_users.php +++ b/usr/local/www/vpn_pptp_users.php @@ -43,7 +43,7 @@ if ($_POST) { if ($_POST['apply']) { $retval = 0; config_lock(); - $retval = vpn_pptpd_configure(); + $retval = vpn_setup(); config_unlock(); $savemsg = get_std_save_message($retval); if ($retval == 0) { |