cpu/esp32: fix of maximum frame length in esp_wifi
Since complete MAC frames are handled, ETHERNET_MAX_LEN has to be used instead of ETHERNET_DATA_LEN for buffer sizes and length checks.
This commit is contained in:
parent
676a615996
commit
5020c30970
@ -79,7 +79,7 @@ esp_err_t _esp_wifi_rx_cb(void *buffer, uint16_t len, void *eb)
|
|||||||
|
|
||||||
DEBUG("%s: buf=%p len=%d eb=%p\n", __func__, buffer, len, eb);
|
DEBUG("%s: buf=%p len=%d eb=%p\n", __func__, buffer, len, eb);
|
||||||
|
|
||||||
if ((buffer == NULL) || (len >= ETHERNET_DATA_LEN)) {
|
if ((buffer == NULL) || (len >= ETHERNET_MAX_LEN)) {
|
||||||
if (eb != NULL) {
|
if (eb != NULL) {
|
||||||
esp_wifi_internal_free_rx_buffer(eb);
|
esp_wifi_internal_free_rx_buffer(eb);
|
||||||
}
|
}
|
||||||
@ -298,7 +298,7 @@ static int _esp_wifi_send(netdev_t *netdev, const iolist_t *iolist)
|
|||||||
|
|
||||||
/* load packet data into TX buffer */
|
/* load packet data into TX buffer */
|
||||||
for (const iolist_t *iol = iolist; iol; iol = iol->iol_next) {
|
for (const iolist_t *iol = iolist; iol; iol = iol->iol_next) {
|
||||||
if (dev->tx_len + iol->iol_len > ETHERNET_DATA_LEN) {
|
if (dev->tx_len + iol->iol_len > ETHERNET_MAX_LEN) {
|
||||||
mutex_unlock(&dev->dev_lock);
|
mutex_unlock(&dev->dev_lock);
|
||||||
return -EOVERFLOW;
|
return -EOVERFLOW;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,10 +38,10 @@ typedef struct
|
|||||||
netdev_t netdev; /**< netdev parent struct */
|
netdev_t netdev; /**< netdev parent struct */
|
||||||
|
|
||||||
uint16_t rx_len; /**< number of bytes received */
|
uint16_t rx_len; /**< number of bytes received */
|
||||||
uint8_t rx_buf[ETHERNET_DATA_LEN]; /**< receive buffer */
|
uint8_t rx_buf[ETHERNET_MAX_LEN]; /**< receive buffer */
|
||||||
|
|
||||||
uint16_t tx_len; /**< number of bytes in transmit buffer */
|
uint16_t tx_len; /**< number of bytes in transmit buffer */
|
||||||
uint8_t tx_buf[ETHERNET_DATA_LEN]; /**< transmit buffer */
|
uint8_t tx_buf[ETHERNET_MAX_LEN]; /**< transmit buffer */
|
||||||
|
|
||||||
uint32_t event; /**< received event */
|
uint32_t event; /**< received event */
|
||||||
bool connected; /**< indicates whether connected to AP */
|
bool connected; /**< indicates whether connected to AP */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user