From ea3edef5c7f6704dcf1ca270aca87ccd503024f6 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Fri, 16 Nov 2018 12:40:10 +0100 Subject: [PATCH] drivers/w5100: Added missing drop implementation The netdev_driver_t::recv implementation of the w5100 does not provide the drop feature. This commit adds it. Fixes: https://github.com/RIOT-OS/RIOT/issues/10410 --- drivers/w5100/w5100.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/w5100/w5100.c b/drivers/w5100/w5100.c index aec5ec2598..2d29e9456e 100644 --- a/drivers/w5100/w5100.c +++ b/drivers/w5100/w5100.c @@ -261,7 +261,10 @@ static int recv(netdev_t *netdev, void *buf, size_t len, void *info) DEBUG("[w5100] recv: read %i byte from device (at 0x%04x)\n", n, (int)rp); + } + /* if frame received OR drop requested, remove frame from RX buffer */ + if (len > 0) { /* set the new read pointer address */ waddr(dev, S0_RX_RD0, S0_RX_RD1, rp += psize); wreg(dev, S0_CR, CR_RECV);