diff --git a/cpu/esp32/esp-eth/esp_eth_netdev.c b/cpu/esp32/esp-eth/esp_eth_netdev.c index 4e75505620..8288b066ec 100644 --- a/cpu/esp32/esp-eth/esp_eth_netdev.c +++ b/cpu/esp32/esp-eth/esp_eth_netdev.c @@ -281,7 +281,7 @@ static int _esp_eth_get(netdev_t *netdev, netopt_t opt, void *val, size_t max_le esp_eth_get_mac((uint8_t *)val); return ETHERNET_ADDR_LEN; case NETOPT_LINK_CONNECTED: - assert(max_len == 1); + assert(max_len == sizeof(netopt_enable_t)); *((netopt_enable_t *)val) = (dev->link_up) ? NETOPT_ENABLE : NETOPT_DISABLE; return sizeof(netopt_enable_t); diff --git a/cpu/esp_common/esp-wifi/esp_wifi_netdev.c b/cpu/esp_common/esp-wifi/esp_wifi_netdev.c index fde2475347..e55c7c5e14 100644 --- a/cpu/esp_common/esp-wifi/esp_wifi_netdev.c +++ b/cpu/esp_common/esp-wifi/esp_wifi_netdev.c @@ -640,10 +640,10 @@ static int _esp_wifi_get(netdev_t *netdev, netopt_t opt, void *val, size_t max_l esp_wifi_get_mac(ESP_MAC_WIFI_STA,(uint8_t *)val); return ETHERNET_ADDR_LEN; case NETOPT_LINK_CONNECTED: - assert(max_len == 1); + assert(max_len == sizeof(netopt_enable_t)); *((netopt_enable_t *)val) = (dev->connected) ? NETOPT_ENABLE : NETOPT_DISABLE; - return 1; + return sizeof(netopt_enable_t); default: return netdev_eth_get(netdev, opt, val, max_len); }