2015-05-30 23:24:46

by Krishna Chaitanya

[permalink] [raw]
Subject: [PATCH] cfg80211: Don't re-use the skb for larger NL messages.

This improves the time to get the DUMP response across to user space.
Signed-off-by: Chaitanya T K <[email protected]>
---
net/wireless/nl80211.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index c264eff..152bd0c 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7636,6 +7636,10 @@ static int nl80211_testmode_dump(struct sk_buff *skb,
}

genlmsg_end(skb, hdr);
+
+ /* Don't re-use skb, when we know nla_put fails*/
+ if (skb->len > NLMSG_GOODSIZE / 2)
+ break;
}

err = skb->len;