Browse Source

Merge pull request #866 from thvdveld/dont-process-empty-packets

fix: don't handle empty packets
Thibaut Vandervelden 1 year ago
parent
commit
4700f2ae42
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/iface/interface/mod.rs

+ 4 - 0
src/iface/interface/mod.rs

@@ -684,6 +684,10 @@ impl Interface {
         while let Some((rx_token, tx_token)) = device.receive(self.inner.now) {
             let rx_meta = rx_token.meta();
             rx_token.consume(|frame| {
+                if frame.is_empty() {
+                    return;
+                }
+
                 match self.inner.caps.medium {
                     #[cfg(feature = "medium-ethernet")]
                     Medium::Ethernet => {