examples/mesh/ip_internal_network: creation of corrupt mesh_netif_driver (IDFGH-13311) #14236
Open
3 tasks done
Labels
Status: Reviewing
Issue is being reviewed
Answers checklist.
General issue report
In mesh_netif.c, the data structure mesh_netif_driver attempts to represent the ESP-WIFI-MESH driver control block. In fact, the declaration of mesh_netif_driver is in fatal conflict with the declaration of wifi_netif_driver in wifi_netif.c. Specifically, the fields wifi_if and sta_mac_addr occupy the same memory location in the control block.
Because ESP-WIFI-MESH 'netif' structures are often passed through esp_wifi APIs, these conflicting field declarations result in the first 4 octets of the ESP32's MAC address being used as the wifi_if index, leading in disastrous runtime results (which have been observed during testing of the ip_internal_network).
While it would at first appear that adding wifi_if to the mesh_netif_driver structure would resolve the conflict, the result is still not correct. In fact, there is no public declaration of the actual ESP-WIFI-MESH driver control block, so any creation or manipulation of the structure within mesh_netif.c can not be assured to be conflict-free with other fields within the actual structure.
For WiFi purposes, not only is the full declaration of the driver control block visible, but the function esp_wifi_create_if_driver() is available to reliably create and initialize the structure. No such public declarations or utility functions appear available to safely create an ESP-WIFI-MESH driver control block.
The text was updated successfully, but these errors were encountered: