提交 0f4821e7 编写于 作者: D David S. Miller 提交者: David S. Miller

[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: NDavid S. Miller <davem@davemloft.net>
上级 09e14305
......@@ -632,8 +632,10 @@ static void rtnetlink_rcv(struct sock *sk, int len)
if (skb->len)
skb_queue_head(&sk->sk_receive_queue,
skb);
else
else {
kfree_skb(skb);
qlen--;
}
break;
}
kfree_skb(skb);
......
......@@ -1024,8 +1024,10 @@ static void xfrm_netlink_rcv(struct sock *sk, int len)
if (skb->len)
skb_queue_head(&sk->sk_receive_queue,
skb);
else
else {
kfree_skb(skb);
qlen--;
}
break;
}
kfree_skb(skb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册