mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-30 06:59:02 +08:00
fix(lwip): fix netif mac addr is not right
This commit is contained in:
@ -271,21 +271,10 @@ _exit:
|
||||
*/
|
||||
int8_t ethernetif_init(struct netif* netif)
|
||||
{
|
||||
uint8_t mac[NETIF_MAX_HWADDR_LEN];
|
||||
|
||||
if (netif == NULL) {
|
||||
LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_init: netif is NULL\n"));
|
||||
}
|
||||
|
||||
/* set MAC hardware address */
|
||||
if (wifi_get_netif(TCPIP_ADAPTER_IF_STA) == TCPIP_ADAPTER_IF_STA) {
|
||||
esp_wifi_get_mac(TCPIP_ADAPTER_IF_STA, mac);
|
||||
} else {
|
||||
esp_wifi_get_mac(TCPIP_ADAPTER_IF_AP, mac);
|
||||
}
|
||||
|
||||
memcpy(netif->hwaddr, mac, NETIF_MAX_HWADDR_LEN);
|
||||
|
||||
#if LWIP_NETIF_HOSTNAME
|
||||
|
||||
netif->hostname = "lwip";
|
||||
|
Reference in New Issue
Block a user