Skip to content

Commit

Permalink
nl80211: Reset split_start when netlink skb is exhausted
Browse files Browse the repository at this point in the history
When the netlink skb is exhausted split_start is left set. In the
subsequent retry, with a larger buffer, the dump is continued from the
failing point instead of from the beginning.

This was causing my rt28xx based USB dongle to now show up when
running "iw list" with an old iw version without split dump support.

Cc: [email protected]
Fixes: 3713b4e ("nl80211: allow splitting wiphy information in dumps")
Signed-off-by: Pontus Fuchs <[email protected]>
[avoid the entire workaround when state->split is set]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
pof2 authored and jmberg-intel committed Feb 6, 2014
1 parent 2f61743 commit f12cb28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1719,9 +1719,10 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
* We can then retry with the larger buffer.
*/
if ((ret == -ENOBUFS || ret == -EMSGSIZE) &&
!skb->len &&
!skb->len && !state->split &&
cb->min_dump_alloc < 4096) {
cb->min_dump_alloc = 4096;
state->split_start = 0;
rtnl_unlock();
return 1;
}
Expand Down

0 comments on commit f12cb28

Please sign in to comment.