def check_ip(ipaddr, logger):
    """
       return a string according to ip address type, return 'ipv4' for ipv4,
       return 'ipv6' for ipv6, return False for others
    """
    addr4 = ipaddr.strip().split('.')
    addr6 = ipaddr.strip().split(':')
    if len(addr4) == 4:
        iptype = 'ipv4'
    elif len(addr6) == 6:
        iptype = 'ipv6'
    else:
        return False
    return iptype
