feat: added the ability to respond to ARP requests
This commit is contained in:
@@ -6,7 +6,9 @@ fn main() -> anyhow::Result<()> {
|
||||
loop {
|
||||
let mut buf = [0u8; 4];
|
||||
|
||||
let Ok((amount, src)) = input.recv_from(&mut buf[..]) else { continue; };
|
||||
let Ok((amount, src)) = input.recv_from(&mut buf[..]) else {
|
||||
continue;
|
||||
};
|
||||
|
||||
if amount != 4 {
|
||||
continue;
|
||||
@@ -14,6 +16,8 @@ fn main() -> anyhow::Result<()> {
|
||||
|
||||
println!("Received packet: {}", i32::from_be_bytes(buf));
|
||||
|
||||
let Ok(_) = input.send_to(&buf, src) else { continue; };
|
||||
let Ok(_) = input.send_to(&buf, src) else {
|
||||
continue;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user