summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorChris Buechler <cmb@cmb-macbook-pro.local>2009-11-14 23:21:46 -0500
committerChris Buechler <cmb@cmb-macbook-pro.local>2009-11-14 23:21:46 -0500
commitcc125e1393e851f294735781d023f9296731a9a9 (patch)
treec6d0b3fe4a43648e67c44fb7bd09aba64188e524 /etc
parent18cbd65fe5e7c751893c240f1eec68e4e8621141 (diff)
downloadpfsense-cc125e1393e851f294735781d023f9296731a9a9.zip
pfsense-cc125e1393e851f294735781d023f9296731a9a9.tar.gz
always return the IP address hosting the page, rather than forcing to the hostname, requiring functional DNS name resolution which possibly doesn't exist. Restores 1.2.x behavior where client IP isn't in the same subnet as any CP-enabled interface.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/captiveportal.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 40db3a5..6b3e804 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1093,6 +1093,16 @@ function portal_ip_from_client_ip($cliip) {
return $ip;
}
+ // doesn't match up to any particular interface
+ // so let's set the portal IP to what PHP says
+ // the server IP issuing the request is.
+ // allows same behavior as 1.2.x where IP isn't
+ // in the subnet of any CP interface (static routes, etc.)
+ // rather than forcing to DNS hostname resolution
+ $ip = $_SERVER['SERVER_ADDR'];
+ if (is_ipaddr($ip))
+ return $ip;
+
return false;
}
OpenPOWER on IntegriCloud