Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ethernet frame header is 14 not 18 #3025

Merged
merged 2 commits into from
Feb 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions esp-wifi/src/wifi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ use crate::{
EspWifiController,
};

const ETHERNET_FRAME_HEADER_SIZE: usize = 18;

const MTU: usize = crate::CONFIG.mtu;

#[cfg(feature = "utils")]
Expand Down Expand Up @@ -947,8 +945,6 @@ impl From<WifiMode> for wifi_mode_t {
}
}

const DATA_FRAME_SIZE: usize = MTU + ETHERNET_FRAME_HEADER_SIZE;

const RX_QUEUE_SIZE: usize = crate::CONFIG.rx_queue_size;
const TX_QUEUE_SIZE: usize = crate::CONFIG.tx_queue_size;

Expand Down Expand Up @@ -2712,7 +2708,7 @@ impl<Dm: Sealed> WifiTxToken<Dm> {
// (safety): creation of multiple WiFi devices with the same mode is impossible
// in safe Rust, therefore only smoltcp _or_ embassy-net can be used at
// one time
static mut BUFFER: [u8; DATA_FRAME_SIZE] = [0u8; DATA_FRAME_SIZE];
static mut BUFFER: [u8; MTU] = [0u8; MTU];

let buffer = unsafe { &mut BUFFER[..len] };

Expand Down
Loading