summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@dds.nl>2011-03-15 16:28:37 +0100
committerSeth Mos <seth.mos@dds.nl>2011-03-15 16:28:37 +0100
commitb47ceaea3aaf234c1eeb7e51facc8bf906206baa (patch)
treed6825cf80f40dcc591fd32c44d7d0f083bd7fdd7 /etc
parent1ae43bfa8536bfe67d62722edfe8256c34834219 (diff)
parent401fb0ad8fa7ad06743435808dac8e913b3c16bb (diff)
downloadpfsense-b47ceaea3aaf234c1eeb7e51facc8bf906206baa.zip
pfsense-b47ceaea3aaf234c1eeb7e51facc8bf906206baa.tar.gz
Merge remote branch 'upstream/master'
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/captiveportal.inc21
-rw-r--r--etc/inc/interfaces.inc24
2 files changed, 25 insertions, 20 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 0363f78..ef59446 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -860,12 +860,15 @@ function captiveportal_disconnect($dbent, $radiusservers,$term_cause = 1,$stop_t
false,
$stop_time);
}
- /* Delete client's ip entry from tables 3 and 4. */
- mwexec("/sbin/ipfw table 1 delete {$dbent[2]}");
- mwexec("/sbin/ipfw table 2 delete {$dbent[2]}");
-
- /* Release the ruleno so it can be reallocated to new clients. */
- captiveportal_free_ipfw_ruleno($dbent[1]);
+
+ if (is_ipaddr($dbent[2])) {
+ /* Delete client's ip entry from tables 3 and 4. */
+ mwexec("/sbin/ipfw table 1 delete {$dbent[2]}");
+ mwexec("/sbin/ipfw table 2 delete {$dbent[2]}");
+ /* XXX: Redundant?! Ensure all pf(4) states are killed. */
+ mwexec("pfctl -k {$dbent[2]}");
+ mwexec("pfctl -K {$dbent[2]}");
+ }
/*
* These are the pipe numbers we use to control traffic shaping for each logged in user via captive portal
@@ -876,10 +879,8 @@ function captiveportal_disconnect($dbent, $radiusservers,$term_cause = 1,$stop_t
mwexec("/sbin/ipfw pipe " . ($dbent[1]+20001) . " delete");
}
- /* XXX: Redundant?! Ensure all pf(4) states are killed. */
- mwexec("pfctl -k {$dbent[2]}");
- mwexec("pfctl -K {$dbent[2]}");
-
+ /* Release the ruleno so it can be reallocated to new clients. */
+ captiveportal_free_ipfw_ruleno($dbent[1]);
}
/* remove a single client by sessionid */
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 07a5320..1fcbc8f 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -1154,7 +1154,14 @@ function handle_pppoe_reset($post_array) {
function interface_ppps_configure($interface) {
global $config, $g;
-
+
+ /* Return for unassigned interfaces. This is a minimum requirement. */
+ if (empty($config['interfaces'][$interface]))
+ return 0;
+ $ifcfg = $config['interfaces'][$interface];
+ if (!isset($ifcfg['enable']))
+ return 0;
+
// mpd5 requires a /var/spool/lock directory for PPP modem links.
if(!is_dir("/var/spool/lock")) {
exec("/bin/mkdir -p /var/spool/lock");
@@ -1163,10 +1170,7 @@ function interface_ppps_configure($interface) {
// mpd5 modem chat script expected in the same directory as the mpd_xxx.conf files
if (!file_exists("{$g['varetc_path']}/mpd.script"))
mwexec("/bin/ln -s /usr/local/sbin/mpd.script {$g['varetc_path']}/.");
-
- $ifcfg = $config['interfaces'][$interface];
- if (!isset($ifcfg['enable']))
- return 0;
+
if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
foreach ($config['ppps']['ppp'] as $pppid => $ppp) {
if ($ifcfg['if'] == $ppp['if'])
@@ -1183,7 +1187,7 @@ function interface_ppps_configure($interface) {
else
$type = $ppp['type'];
$upper_type = strtoupper($ppp['type']);
-
+
if($g['booting']) {
$descr = isset($ifcfg['descr']) ? $ifcfg['descr'] : strtoupper($interface);
echo "starting {$pppif} link...";
@@ -1191,7 +1195,7 @@ function interface_ppps_configure($interface) {
if(file_exists("{$g['varrun_path']}/{$ppp['type']}_{$interface}.pid"))
return 0;
}
-
+
$ports = explode(',',$ppp['ports']);
if ($type != "modem") {
foreach ($ports as $pid => $port)
@@ -1200,10 +1204,10 @@ function interface_ppps_configure($interface) {
$localips = explode(',',$ppp['localip']);
$gateways = explode(',',$ppp['gateway']);
$subnets = explode(',',$ppp['subnet']);
-
+
/* We bring up the parent interface first because if DHCP is configured on the parent we need
- to obtain an address first so we can write it in the mpd .conf file for PPTP and L2TP configs
- */
+ * to obtain an address first so we can write it in the mpd .conf file for PPTP and L2TP configs
+ */
foreach($ports as $pid => $port){
switch ($ppp['type']) {
case "pppoe":
OpenPOWER on IntegriCloud