瀏覽代碼

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

fix: don't handle empty packets
Thibaut Vandervelden 1 年之前
父節點
當前提交
4700f2ae42
共有 1 個文件被更改,包括 4 次插入0 次删除
  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 => {