Commit aa1c6a6f authored by Tommy S. Christensen's avatar Tommy S. Christensen Committed by David S. Miller
Browse files

[NETLINK]: Defer socket destruction a bit

In netlink_broadcast() we're sending shared skb's to netlink listeners
when possible (saves some copying). This is OK, since we hold the only
other reference to the skb.

However, this implies that we must drop our reference on the skb, before
allowing a receiving socket to disappear. Otherwise, the socket buffer
accounting is disrupted.
Signed-off-by: default avatarTommy S. Christensen <>
Acked-by: default avatarHerbert Xu <>
Signed-off-by: default avatarDavid S. Miller <>
parent 68acc024
......@@ -789,11 +789,12 @@ int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, u32 pid,
sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list)
do_one_broadcast(sk, &info);
if (info.skb2)
if (info.delivered) {
if (info.congested && (allocation & __GFP_WAIT))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment