summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-03-15 12:52:11 +0000
committerErmal <eri@pfsense.org>2011-03-15 12:52:11 +0000
commit32c392aa4bce84cbe6491d3ed8fffb15e2274108 (patch)
tree259ce168317214f404bcf08222c2aebc3b10aa2e /etc
parent01c201e3d19dd7fc37e8b33f1d27861e514c805c (diff)
downloadpfsense-32c392aa4bce84cbe6491d3ed8fffb15e2274108.zip
pfsense-32c392aa4bce84cbe6491d3ed8fffb15e2274108.tar.gz
Make sure we have an ip to kill sessions from.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/captiveportal.inc21
1 files changed, 11 insertions, 10 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 */
OpenPOWER on IntegriCloud