projects
/
dnsseed-rust
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
96812ac
)
Never allow non-resolving-to-ASN IPs
author
Matt Corallo
<git@bluematt.me>
Fri, 23 Aug 2019 04:39:27 +0000
(
00:39
-0400)
committer
Matt Corallo
<git@bluematt.me>
Fri, 23 Aug 2019 04:39:27 +0000
(
00:39
-0400)
src/datastore.rs
patch
|
blob
|
history
diff --git
a/src/datastore.rs
b/src/datastore.rs
index c8ef0e0aed812f52599ac6d1ca47dcde0692e48b..c00bc0165a71d98ef8ed80d17a0d88a5e970d4a5 100644
(file)
--- 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()));
}
}
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();
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);
}
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);
}