nl80211: Reset split_start on error path when split dump is not used
PATCH 1/1 nl80211: Reset split_start on error path when split dump is not used
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.
--- net/wireless/nl80211.c | 2 ++ 1 file changed, 2 insertions(+)
Supersedes "nl80211: Don't touch split_start when split dump is not used"
net/wireless/nl80211.c +2 -0
@@ -1631,6 +1631,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,return genlmsg_end (msg, hdr); nla_put_failure: +if (!state->split) + state->split_start =0 ;genlmsg_cancel (msg, hdr);return -EMSGSIZE ; }
Signature · 1 line
1.8.3.2
Johannes Berg
maintainerQuoted 3 lines · Pontus Fuchs
When the netlink skb is exhausted
split_startis left set. In the subsequent retry, with a larger buffer, the dump is continued from the failing point instead of from the beginning.
Hmm. Maybe it should be like this instead?
johannes
net/wireless/nl80211.c +1 -0
@@ -1680,6 +1680,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) !skb->len && cb->min_dump_alloc < 4096) { cb->min_dump_alloc =4096 ; + state->split_start =0 ;rtnl_unlock ();return 1 ; }
Quoted 14 lines · Johannes Berg
Quoted 3 lines · Pontus Fuchs
When the netlink skb is exhausted
split_startis left set. In the subsequent retry, with a larger buffer, the dump is continued from the failing point instead of from the beginning.Hmm. Maybe it should be like this instead?
johannes
net/wireless/nl80211.c +0
-0
net/wireless/nl80211.c static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) · line 1686
Quoted 7 lines
net/wireless/nl80211.c +1
-0@@ -1680,6 +1680,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) !skb->len && cb->min_dump_alloc < 4096) { cb->min_dump_alloc =4096 ; + state->split_start =0 ;rtnl_unlock ();return 1 ; }
Will that not cause problem if split scan is in use and one of the split chunks needs to be resent due to EMSGSIZE?
//Pontus
Johannes Berg
maintainerQuoted 10 lines · Pontus Fuchs
Quoted 9 lines · Johannes Berg
Quoted 3 lines · Pontus Fuchs
When the netlink skb is exhausted
split_startis left set. In the subsequent retry, with a larger buffer, the dump is continued from the failing point instead of from the beginning.Hmm. Maybe it should be like this instead?
johannes
Quoted 15 lines
net/wireless/nl80211.c static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) · line 1686
Quoted 12 lines
net/wireless/nl80211.c +1
-0@@ -1680,6 +1680,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) !skb->len && cb->min_dump_alloc < 4096) { cb->min_dump_alloc =4096 ; + state->split_start =0 ;rtnl_unlock ();return 1 ; }Will that not cause problem if split scan is in use and one of the split chunks needs to be resent due to EMSGSIZE?
That's not supposed to happen, and the "!skb->len" check should catch it.
johannes
Quoted 12 lines · Johannes Berg
Quoted 11 lines
net/wireless/nl80211.c static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) · line 1686
Quoted 8 lines
net/wireless/nl80211.c +1
-0@@ -1680,6 +1680,7 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb) !skb->len && cb->min_dump_alloc < 4096) { cb->min_dump_alloc =4096 ; + state->split_start =0 ;rtnl_unlock ();return 1 ; }Will that not cause problem if split scan is in use and one of the split chunks needs to be resent due to EMSGSIZE?
Quoted 4 lines
That's not supposed to happen, and the "!skb->len" check should catch it.
johannes
Ok. Thanks. Lets go for that version then.
//Pontus