mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
improve resilience to ping flood attack
much better, but still eventually the stack can fall over eventually. also, the stack doesn't behave well when you try to initiate new commands in the middle of a flood, because the back-pressure mechanisms are primarily in-stack at the moment. I think i have an idea on how to fix that but this will have to be later.
This commit is contained in:
parent
81edf6a9c0
commit
db454603ee
1 changed files with 10 additions and 2 deletions
|
|
@ -618,10 +618,18 @@ fn xmain() -> ! {
|
|||
None => {} //log::info!("pushed {} bytes avail to iface", rxlen),
|
||||
Some(_) => log::warn!("Got more packets, but smoltcp didn't drain them in time"),
|
||||
}
|
||||
send_message(
|
||||
match xous::try_send_message(
|
||||
net_conn,
|
||||
Message::new_scalar(Opcode::NetPump.to_usize().unwrap(), 0, 0, 0, 0)
|
||||
).expect("WlanRxReady couldn't pump the loop");
|
||||
) {
|
||||
Ok(_) => {},
|
||||
Err(xous::Error::ServerQueueFull) => {
|
||||
log::warn!("Our net queue runneth over, packets will be dropped.");
|
||||
},
|
||||
Err(e) => {
|
||||
log::error!("Unhandled error sending NetPump to self: {:?}", e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log::error!("Got RxReady interrupt but no packet length specified!");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue