On Mon, 2008-09-29 at 13:52 +0200, Jiri Slaby wrote: > --- a/net/wireless/nl80211.c > +++ b/net/wireless/nl80211.c > @@ -246,16 +246,26 @@ static int nl80211_get_wiphy(struct sk_buff *skb, struct > genl_info *info) > { > struct sk_buff *msg; > struct cfg80211_registered_device *dev; > + size_t bufsize = NLMSG_GOODSIZE; > + unsigned int tries = 0; > + int ret; > > dev = cfg80211_get_dev_from_info(info); > if (IS_ERR(dev)) > return PTR_ERR(dev); > > - msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); > +retry: > + msg = nlmsg_new(bufsize, GFP_KERNEL); > if (!msg) > goto out_err; > > - if (nl80211_send_wiphy(msg, info->snd_pid, info->snd_seq, 0, dev) < 0) > + ret = nl80211_send_wiphy(msg, info->snd_pid, info->snd_seq, 0, dev); > + if (ret == -EMSGSIZE && ++tries < 2) { > + bufsize *= 2; > + nlmsg_free(msg); > + goto retry; > + } > + if (ret < 0) > goto out_free; > > cfg80211_put_dev(dev); > Works for me. Not the greatest way to do this I guess, but hey, it works. johannes
Attachment:
signature.asc
Description: This is a digitally signed message part