diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2005-05-03 15:30:05 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-05-03 15:30:05 -0700 |
commit | 09e14305982efc2f3b509d3c50ef5dcbff64a998 (patch) | |
tree | 7829c8b212a84e793ebf2d5bd0ceb68283c7b79e /net/core | |
parent | 2a0a6ebee1d68552152ae8d4aeda91d806995dec (diff) |
[NETLINK]: Fix infinite loops in synchronous netlink changes.
The qlen should continue to decrement, even if we
pop partially processed SKBs back onto the receive queue.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/rtnetlink.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 6e1ab1e34b2..75b6d33b529 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -626,14 +626,13 @@ static void rtnetlink_rcv(struct sock *sk, int len) if (qlen > skb_queue_len(&sk->sk_receive_queue)) qlen = skb_queue_len(&sk->sk_receive_queue); - while (qlen--) { + for (; qlen; qlen--) { skb = skb_dequeue(&sk->sk_receive_queue); if (rtnetlink_rcv_skb(skb)) { - if (skb->len) { + if (skb->len) skb_queue_head(&sk->sk_receive_queue, skb); - qlen++; - } else + else kfree_skb(skb); break; } |