net: Ignore everything in RX if interface is not up

No need to receive anything if network interface is down.

Change-Id: I22d62aeaf4fbef54608818bf6c8073ec2e9a7c09
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2017-03-13 15:57:12 +02:00
parent 318afc4519
commit 185f36034f
1 changed files with 4 additions and 0 deletions

View File

@ -716,6 +716,10 @@ int net_recv_data(struct net_if *iface, struct net_buf *buf)
return -ENODATA;
}
if (!atomic_test_bit(iface->flags, NET_IF_UP)) {
return -ENETDOWN;
}
NET_DBG("fifo %p iface %p buf %p len %zu", &rx_queue, iface, buf,
net_buf_frags_len(buf));