mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 13:41:15 -07:00
Fix private IP address for IPv6
This commit is contained in:
parent
98411f0715
commit
18b328a387
1 changed files with 3 additions and 1 deletions
|
@ -232,7 +232,9 @@ function getPlatformImagePath(platformName) {
|
||||||
|
|
||||||
function isPrivateIP(ip_address) {
|
function isPrivateIP(ip_address) {
|
||||||
if (ip_address.indexOf(".") > -1) {
|
if (ip_address.indexOf(".") > -1) {
|
||||||
var parts = ip_address.split('.');
|
// get IPv4 mapped address (xxx.xxx.xxx.xxx) from IPv6 addresss (::ffff:xxx.xxx.xxx.xxx)
|
||||||
|
var parts = ip_address.split(":");
|
||||||
|
var parts = parts[parts.length - 1].split('.');
|
||||||
if (parts[0] === '10' ||
|
if (parts[0] === '10' ||
|
||||||
(parts[0] === '172' && (parseInt(parts[1], 10) >= 16 && parseInt(parts[1], 10) <= 31)) ||
|
(parts[0] === '172' && (parseInt(parts[1], 10) >= 16 && parseInt(parts[1], 10) <= 31)) ||
|
||||||
(parts[0] === '192' && parts[1] === '168')) {
|
(parts[0] === '192' && parts[1] === '168')) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue