Skip to content
Snippets Groups Projects
Commit 538aac00 authored by Gunar Schorcht's avatar Gunar Schorcht Committed by Schorcht
Browse files

cpu/esp8266: fix of allocated pbuf in esp_wifi

parent e384f1e5
No related branches found
No related tags found
No related merge requests found
...@@ -68,6 +68,9 @@ ...@@ -68,6 +68,9 @@
#define MAC_STR "%02x:%02x:%02x:%02x:%02x:%02x" #define MAC_STR "%02x:%02x:%02x:%02x:%02x:%02x"
#define MAC_STR_ARG(m) m[0], m[1], m[2], m[3], m[4], m[5] #define MAC_STR_ARG(m) m[0], m[1], m[2], m[3], m[4], m[5]
#define PBUF_IEEE80211_HLEN (36)
/** Timer used to reconnect automatically after 20 seconds if not connected */ /** Timer used to reconnect automatically after 20 seconds if not connected */
static xtimer_t _esp_wifi_reconnect_timer; static xtimer_t _esp_wifi_reconnect_timer;
...@@ -328,7 +331,7 @@ static int IRAM _send(netdev_t *netdev, const iolist_t *iolist) ...@@ -328,7 +331,7 @@ static int IRAM _send(netdev_t *netdev, const iolist_t *iolist)
struct netif *sta_netif = (struct netif *)eagle_lwip_getif(ESP_WIFI_STATION_IF); struct netif *sta_netif = (struct netif *)eagle_lwip_getif(ESP_WIFI_STATION_IF);
netif_set_default(sta_netif); netif_set_default(sta_netif);
struct pbuf *pb = pbuf_alloc(PBUF_LINK, iol_len, PBUF_RAM); struct pbuf *pb = pbuf_alloc(PBUF_LINK, iol_len + PBUF_IEEE80211_HLEN, PBUF_RAM);
if (pb == NULL || pb->tot_len < iol_len) { if (pb == NULL || pb->tot_len < iol_len) {
ESP_WIFI_DEBUG("could not allocate buffer to send %d bytes ", iol_len); ESP_WIFI_DEBUG("could not allocate buffer to send %d bytes ", iol_len);
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment