On Fri, 2005-12-16 at 16:30 +0100, francesco rana wrote: > --- ieee80211softmac_wx.c 2005-12-11 18:01:54.000000000 +0100 > +++ ieee80211softmac_wx.c_orig 2005-12-14 17: 59:48.000000000 +0100
Agh. And I was wondering what was wrong with the patch. Hint: use diff -u orig new and not the other way around :) > @@ -79,22 +79,19 @@: > /* If all fails, return ANY (empty) */ > data->essid.length = 0; > data->essid.flags = 0; /* active */ > -: > - if(extra) {: IMHO that ought to be | if (!extra) { | // unlock if necessary, not sure right now. | return -EINVAL; | } instead. > - /* If we have a statically configured ESSID then return : > it */: > - if (sm->associnfo.static_essid) {: > - data->essid.length = sm->associnfo.req_essid_len;: > - data->essid.flags = 1; /* active */: > - memcpy(extra, sm->associnfo.req_essid, : > sm->associnfo.req_essid_len);: > - }: > -: > - /* If we're associating/associated, return that */: > - if (sm->associated || sm->associnfo.associating) {: > - : > sm->associnfo.associate_essid_len=strlen(sm->associnfo.associate_essid);: Your patch is word-wrapped here, please make sure that doesn't happen. > - data->essid.length = : > sm->associnfo.associate_essid_len;: > - data->essid.flags = 1; /* active */: > - memcpy(extra, sm->associnfo.associate_essid, : > sm->associnfo.associate_essid_len);: > - }: > +: > + /* If we have a statically configured ESSID then return it */: > + if (sm->associnfo.static_essid) {: > + data->essid.length = sm->associnfo.req_essid_len;: > + data->essid.flags = 1; /* active */: > + memcpy(extra, sm->associnfo.req_essid, : > sm->associnfo.req_essid_len);: > + }: > +: > + /* If we're associating/associated, return that */: > + if (sm->associated || sm->associnfo.associating) {: > + data->essid.length = sm->associnfo.associate_essid_len;: > + data->essid.flags = 1; /* active */: > + memcpy(extra, sm->associnfo.associate_essid, : > sm->associnfo.associate_essid_len);: > } > spin_unlock_irqrestore(&sm->lock, flags); > return 0; Hmm, ok, I don't think I can make out what you actually changed. Did you only add the extra check? > I hope this would helps: Ah. > the main problem is that if I set an "any" ESSID the req_essid_len and > the associate_essid_len are set both to zero. So we copy nothing. Hm? I really don't see where the bug was. I don't even see an actual code change. Maybe it helps if you can post a new patch that doesn't change the indentation and thus only shows the few things you changed as change. > The > control on "extra" value is necessary because it happens to be <NULL> or > 0x000000 value. So it would be a non-sense to operate in such case. Yeah, ok, but please do as I wrote above, it makes the indentation smaller ;) johannes
signature.asc
Description: This is a digitally signed message part