summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xusr/local/captiveportal/index.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php
index c0936b7..d325835 100755
--- a/usr/local/captiveportal/index.php
+++ b/usr/local/captiveportal/index.php
@@ -95,14 +95,15 @@ $macfilter = !isset($config['captiveportal'][$cpzone]['nomacfilter']);
$passthrumac = isset($config['captiveportal'][$cpzone]['passthrumacadd']);
/* find MAC address for client */
-if ($macfilter || $passthrumac)
+if ($macfilter || $passthrumac) {
$clientmac = arp_get_mac_by_ip($clientip);
-if (!$clientmac && ($macfilter || $passthrumac)) {
- /* unable to find MAC address - shouldn't happen! - bail out */
- captiveportal_logportalauth("unauthenticated","noclientmac",$clientip,"ERROR");
- echo "An error occurred. Please check the system logs for more information.";
- log_error("Captive portal could not determine client's MAC address. Disable MAC address filtering in captive portal if you do not need this functionality.");
- exit;
+ if (!$clientmac) {
+ /* unable to find MAC address - shouldn't happen! - bail out */
+ captiveportal_logportalauth("unauthenticated","noclientmac",$clientip,"ERROR");
+ echo "An error occurred. Please check the system logs for more information.";
+ log_error("Captive portal could not determine client's MAC address. Disable MAC address filtering in captive portal if you do not need this functionality.");
+ exit;
+ }
}
/* find out if we need RADIUS + RADIUSMAC or not */
OpenPOWER on IntegriCloud