diff options
Diffstat (limited to 'usr/local/captiveportal')
-rwxr-xr-x | usr/local/captiveportal/index.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index 5858174..0b86e84 100755 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -69,10 +69,14 @@ if (isset($cpcfg['httpslogin'])) $ourhostname = $cpcfg['httpsname'] . ":" . $listenporthttps; else { $ifip = portal_ip_from_client_ip($clientip); - if (!$ifip) + if (!$ifip) { $ourhostname = "{$config['system']['hostname']}.{$config['system']['domain']}:{$listenporthttp}"; - else - $ourhostname = "{$ifip}:{$listenporthttp}"; + } else { + if (is_ipaddrv6($ifip)) + $ourhostname = "[{$ifip}]:{$listenporthttp}"; + else + $ourhostname = "{$ifip}:{$listenporthttp}"; + } } if ($orig_host != $ourhostname) { |