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:
bunnie 2021-10-28 18:38:02 +08:00
parent 81edf6a9c0
commit db454603ee

View file

@ -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!");
}