From: Matt Corallo Date: Fri, 23 Aug 2019 04:39:27 +0000 (-0400) Subject: Never allow non-resolving-to-ASN IPs X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=9640749bafef6edbe18540c2ce4bc1d5bea80a17;p=dnsseed-rust Never allow non-resolving-to-ASN IPs --- diff --git a/src/datastore.rs b/src/datastore.rs index c8ef0e0..c00bc01 100644 --- a/src/datastore.rs +++ b/src/datastore.rs @@ -499,10 +499,12 @@ impl Store { } } let mut asn_set = HashSet::with_capacity(cmp::max(v4_set.len(), v6_set.len())); + asn_set.insert(0); for a in v4_set.iter().filter(|a| asn_set.insert(bgp_client.get_asn(**a))).choose_multiple(&mut rng, 21) { dns_buff += &format!("x{:x}.dnsseed\tIN\tA\t{}\n", i, a); } asn_set.clear(); + asn_set.insert(0); for a in v6_set.iter().filter(|a| asn_set.insert(bgp_client.get_asn(**a))).choose_multiple(&mut rng, 12) { dns_buff += &format!("x{:x}.dnsseed\tIN\tAAAA\t{}\n", i, a); }