File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -197,10 +197,25 @@ def getBatchDetails(
197197 batch_size = BATCH_MAX_SIZE
198198
199199 result = {}
200+ lookup_addresses = []
201+
202+ # check if bogon.
203+ for ip_address in ip_addresses :
204+ if isinstance (ip_address , IPv4Address ) or isinstance (
205+ ip_address , IPv6Address
206+ ):
207+ ip_address = ip_address .exploded
208+
209+ if ip_address and is_bogon (ip_address ):
210+ details = {}
211+ details ["ip" ] = ip_address
212+ details ["bogon" ] = True
213+ return Details (details )
214+ else :
215+ lookup_addresses .append (ip_address )
200216
201217 # pre-populate with anything we've got in the cache, and keep around
202218 # the IPs not in the cache.
203- lookup_addresses = []
204219 for ip_address in ip_addresses :
205220 # if the supplied IP address uses the objects defined in the
206221 # built-in module ipaddress extract the appropriate string notation
You can’t perform that action at this time.
0 commit comments