'This method converts any address to ipset format.
If an address has a mask of /0 we need to cover to it to a mask of
/1 as ipset does not support /0 length addresses. Instead we use two
/1\'s to represent the /0.'

def _sanitize_addresses(self, addresses):

    sanitized_addresses = []
    for ip in addresses:
        ip = netaddr.IPNetwork(ip)
        if (ip.prefixlen == 0):
            if (ip.version == 4):
                sanitized_addresses.append('0.0.0.0/1')
                sanitized_addresses.append('128.0.0.0/1')
            elif (ip.version == 6):
                sanitized_addresses.append('::/1')
                sanitized_addresses.append('8000::/1')
        else:
            sanitized_addresses.append(str(ip))
    return sanitized_addresses
