diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2005-05-03 19:15:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-05-03 19:15:59 -0400 |
commit | 0f4821e7b93fe72e89b8ff393bd8e705bd178aa5 (patch) | |
tree | e9116a4ce6593b186c3962fcdc5baf73f243d0b5 /net/xfrm/xfrm_user.c | |
parent | 09e14305982efc2f3b509d3c50ef5dcbff64a998 (diff) |
[XFRM/RTNETLINK]: Decrement qlen properly in {xfrm_,rt}netlink_rcv().
If we free up a partially processed packet because it's
skb->len dropped to zero, we need to decrement qlen because
we are dropping out of the top-level loop so it will do
the decrement for us.
Spotted by Herbert Xu.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm/xfrm_user.c')
-rw-r--r-- | net/xfrm/xfrm_user.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index e8740a4a1d78..5ddda2c98af9 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -1024,8 +1024,10 @@ static void xfrm_netlink_rcv(struct sock *sk, int len) | |||
1024 | if (skb->len) | 1024 | if (skb->len) |
1025 | skb_queue_head(&sk->sk_receive_queue, | 1025 | skb_queue_head(&sk->sk_receive_queue, |
1026 | skb); | 1026 | skb); |
1027 | else | 1027 | else { |
1028 | kfree_skb(skb); | 1028 | kfree_skb(skb); |
1029 | qlen--; | ||
1030 | } | ||
1029 | break; | 1031 | break; |
1030 | } | 1032 | } |
1031 | kfree_skb(skb); | 1033 | kfree_skb(skb); |