summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/receive.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/receive.c b/src/receive.c
index 1e8a242..f9d8228 100644
--- a/src/receive.c
+++ b/src/receive.c
@@ -379,6 +379,9 @@ int packet_rx_poll(struct napi_struct *napi, int budget)
int work_done = 0;
bool free;
+ if (unlikely(budget <= 0))
+ return 0;
+
while ((skb = __ptr_ring_peek(&queue->ring)) != NULL && (state = atomic_read(&PACKET_CB(skb)->state)) != PACKET_STATE_UNCRYPTED) {
__ptr_ring_discard_one(&queue->ring);
peer = PACKET_PEER(skb);