udp load test: don't generate announce requests with port 0

This commit is contained in:
Joakim Frostegård 2024-02-02 14:28:13 +01:00
parent bbb4c5e411
commit f2d063d6a6

View file

@ -1,5 +1,6 @@
use std::io::Cursor;
use std::net::SocketAddr;
use std::num::NonZeroU16;
use std::sync::atomic::Ordering;
use std::time::Duration;
@ -192,7 +193,7 @@ impl Worker {
scrape_hash_indices,
connection_id,
peer_id: generate_peer_id(),
port: Port::new(self.rng.gen()),
port: Port::new(self.rng.gen::<NonZeroU16>().into()),
}
}