nal: Fix infinite loop when TX buffer is full
* For example, if the PHY linkup is down, instead of looping until resumption of the linkup, a write operation now closes the socket for re-connection in the future
This commit is contained in:
parent
6de19f43cc
commit
2eadb652ff
@ -247,6 +247,12 @@ where
|
||||
};
|
||||
match result {
|
||||
Ok(num_bytes) => {
|
||||
// If the buffer is completely filled, close the socket and
|
||||
// return an error
|
||||
if num_bytes == 0 {
|
||||
write_error = true;
|
||||
break;
|
||||
}
|
||||
// In case the buffer is filled up, push bytes into ethernet driver
|
||||
if num_bytes != non_queued_bytes.len() {
|
||||
self.update()?;
|
||||
|
Loading…
Reference in New Issue
Block a user