udp: ignore requests with source port of value zero

This commit is contained in:
Joakim Frostegård 2022-07-03 21:51:09 +02:00
parent e485a9ae45
commit ae77c7426e

View file

@ -31,6 +31,12 @@ pub fn read_requests(
loop {
match socket.recv_from(&mut buffer[..]) {
Ok((amt, src)) => {
if src.port() == 0 {
::log::info!("Ignored request from {} because source port is zero", src);
continue;
}
let res_request =
Request::from_bytes(&buffer[..amt], config.protocol.max_scrape_torrents);