diff --git a/cpu/esp32/esp-eth/esp_eth_netdev.c b/cpu/esp32/esp-eth/esp_eth_netdev.c
index e5ef2eeafc875d359f306f821f2d76d46449f43d..d8cacc7ef4b99567c01bd4bfff7fbc6cc23c0887 100644
--- a/cpu/esp32/esp-eth/esp_eth_netdev.c
+++ b/cpu/esp32/esp-eth/esp_eth_netdev.c
@@ -245,48 +245,39 @@ static int _esp_eth_recv(netdev_t *netdev, void *buf, size_t len, void *info)
 
     int size = dev->rx_len;
 
-    if (!buf && !len) {
-        /* return the size without dropping received data */
-        mutex_unlock(&dev->dev_lock);
-        return size;
-    }
-
-    if (!buf && len) {
-        /* return the size and drop received data */
+    if (!buf) {
+        /* get the size of the frame; if len > 0 then also drop the frame */
+        if (len > 0) {
+            /* drop frame requested */
+            dev->rx_len = 0;
+        }
         mutex_unlock(&dev->dev_lock);
-        dev->rx_len = 0;
         return size;
     }
 
-    if (buf && len && dev->rx_len) {
-        /* return the packet */
-
-        if (dev->rx_len > len) {
+    if (dev->rx_len > len) {
         /* buffer is smaller than the number of received bytes */
         DEBUG("%s: Not enough space in receive buffer for %d bytes\n",
-            mutex_unlock(&dev->dev_lock);
-            return -ENOBUFS;
-        }
-
-        #if ENABLE_DEBUG
-        /* esp_hexdump (dev->rx_buf, dev->rx_len, 'b', 16); */
-        #endif
+              __func__, dev->rx_len);
+        mutex_unlock(&dev->dev_lock);
+        return -ENOBUFS;
+    }
 
-        /* copy received date and reset the receive length */
-        memcpy(buf, dev->rx_buf, dev->rx_len);
-        dev->rx_len = 0;
+    #if ENABLE_DEBUG
+    /* esp_hexdump (dev->rx_buf, dev->rx_len, 'b', 16); */
+    #endif
 
-        #ifdef MODULE_NETSTATS_L2
-        netdev->stats.rx_count++;
-        netdev->stats.rx_bytes += size;
-        #endif
+    /* copy received date and reset the receive length */
+    memcpy(buf, dev->rx_buf, dev->rx_len);
+    dev->rx_len = 0;
 
-        mutex_unlock(&dev->dev_lock);
-        return size;
-    }
+    #ifdef MODULE_NETSTATS_L2
+    netdev->stats.rx_count++;
+    netdev->stats.rx_bytes += size;
+    #endif
 
     mutex_unlock(&dev->dev_lock);
-    return -EINVAL;
+    return size;
 }
 
 static int _esp_eth_get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)