diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-05-27 23:07:38 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-05-27 23:07:38 +0000 |
commit | 6f9f079e658e15d12ce7523628b696f7408616b1 (patch) | |
tree | beddf293fe69573d25f8c4d516ab0fe4e515ab9b /etc | |
parent | 7a4d9546873333f47f7c4c43ff8137b03dc19dcf (diff) | |
download | pfsense-6f9f079e658e15d12ce7523628b696f7408616b1.zip pfsense-6f9f079e658e15d12ce7523628b696f7408616b1.tar.gz |
Use arp table to deterimine when we need to flush an old captive portal user from the pf table <captiveportal>
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/captiveportal.inc | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 7ec1fd4..4c4e5a9 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -263,8 +263,8 @@ function captiveportal_prune_old() { /* if an idle timeout is specified, get last activity timestamp from pf */ // XXX: we need a solution for this. if (!$timedout && $idletimeout) { - $lastact = captiveportal_get_last_activity($cpdb[$i][1]); - if ($lastact && ((time() - $lastact) >= $idletimeout)) + $isactive = captiveportal_get_last_activity($cpdb[$i][2]); + if($isactive == 0) $timedout = true; } @@ -439,18 +439,11 @@ function captiveportal_allowedip_configure() { } /* get last activity timestamp given pf table item */ -function captiveportal_get_last_activity($ruleno) { +function captiveportal_get_last_activity($ip) { - // XXX: this needs a solution - //exec("/sbin/ipfw -T list {$ruleno} 2>/dev/null", $ipfwoutput); + $info = `/usr/sbin/arp | /usr/bin/grep $ip`; - /* - if ($ipfwoutput[0]) { - $ri = explode(" ", $ipfwoutput[0]); - if ($ri[1]) - return $ri[1]; - } - */ + if($info <> "") return 1; return 0; } |