Return Optional.empty() for present-but-not-routed IPs.

This commit is contained in:
Jon Chambers
2021-05-18 17:17:20 -04:00
committed by Jon Chambers
parent b89de860d3
commit 94ac3f6cc8
3 changed files with 4 additions and 1 deletions

View File

@@ -71,7 +71,8 @@ class AsnTable {
return Optional.ofNullable(asnBlocksByFirstIp.floorEntry(addressAsLong))
.filter(entry -> entry.getValue().contains(addressAsLong))
.map(entry -> entry.getValue().getAsn());
.map(entry -> entry.getValue().getAsn())
.filter(asn -> asn != 0);
}
public Optional<String> getCountryCode(final long asn) {