Don't detect cjdns ips as private ips
This commit is contained in:
parent
43d2d5334a
commit
88ba0c1154
1 changed files with 2 additions and 1 deletions
|
@ -12,6 +12,7 @@ import gevent
|
||||||
if "inet_pton" not in dir(socket):
|
if "inet_pton" not in dir(socket):
|
||||||
import win_inet_pton
|
import win_inet_pton
|
||||||
|
|
||||||
|
|
||||||
from Config import config
|
from Config import config
|
||||||
|
|
||||||
|
|
||||||
|
@ -248,7 +249,7 @@ def isIp(ip):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
local_ip_pattern = re.compile(r"^(127\.)|(192\.168\.)|(10\.)|(172\.1[6-9]\.)|(172\.2[0-9]\.)|(172\.3[0-1]\.)|(::1$)|([fF][cCdD])")
|
local_ip_pattern = re.compile(r"^(127\.)|(192\.168\.)|(10\.)|(172\.1[6-9]\.)|(172\.2[0-9]\.)|(172\.3[0-1]\.)|(::1$)|fe80")
|
||||||
def isPrivateIp(ip):
|
def isPrivateIp(ip):
|
||||||
return local_ip_pattern.match(ip)
|
return local_ip_pattern.match(ip)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue