configurator.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:Home-Assistant 作者: jmart518 项目源码 文件源码
def check_access(clientip):
    global BANNED_IPS
    if clientip in BANNED_IPS:
        return False
    if not ALLOWED_NETWORKS:
        return True
    for net in ALLOWED_NETWORKS:
        ipobject = ipaddress.ip_address(clientip)
        if ipobject in ipaddress.ip_network(net):
            return True
    BANNED_IPS.append(clientip)
    return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号