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

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2021-05-18 17:43:30 -04:00
1 parent b89de860d3
commit 94ac3f6cc8
3 files changed
+4 -1

No files matched your search

@@ -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) {