wpa_supplicant for ad-hoc mode
Dan Williams
dcbw
Tue Mar 3 06:46:23 PST 2009
On Mon, 2009-03-02 at 23:29 -0500, Dan Williams wrote:
> On Mon, 2009-03-02 at 13:15 -0700, Shawn Rutledge wrote:
> > Next problem though: if one peer is not running wpa_supplicant, it can
> > work. If both peers are running wpa_supplicant, they will keep timing
> > out. Each timeout, the ESSID is de-configured:
> >
> > wlan0 Disconnected ESSID:off/any
> > Mode:Managed Access Point: Not-Associated Bit Rate=1 Mb/s
> >
> > Authentication with 00:00:00:00:00:00 timed out.
> > BSSID 00:00:00:00:00:00 blacklist count incremented to 12
> > No keys have been configured - skip key clearing
> > State: ASSOCIATING -> DISCONNECTED
> >
> > I tried to fix it like this:
> >
> > static void wpa_supplicant_timeout(void *eloop_ctx, void *timeout_ctx)
> > {
> > struct wpa_supplicant *wpa_s = eloop_ctx;
> > const u8 *bssid = wpa_s->bssid;
> > if (is_zero_ether_addr(bssid))
> > bssid = wpa_s->pending_bssid;
> > wpa_msg(wpa_s, MSG_INFO, "Authentication with " MACSTR " timed out.",
> > MAC2STR(bssid));
> > // In ad-hoc mode, this can be normal because we're waiting for a
> > // peer to appear with the same SSID.
> > if ( wpa_s->current_ssid->mode == IEEE80211_MODE_INFRA)
> > {
> > wpa_blacklist_add(wpa_s, bssid);
> > wpa_sm_notify_disassoc(wpa_s->wpa);
> > wpa_supplicant_disassociate(wpa_s, WLAN_REASON_DEAUTH_LEAVING);
> > }
> > wpa_s->reassociate = 1;
> > wpa_supplicant_req_scan(wpa_s, 0, 0);
> > }
> >
> > which tentatively seems to be working.
> >
> > Why doesn't anybody comment on this thread? Is nobody interested
> > using wpa_supplicant in ad-hoc mode? Is there something wrong with
> > the very idea of it? I think it would be helpful for easy wireless
> > configuration in every Linux distro, if one could unconditionally run
> > wpa_supplicant on every system, and it fit every wireless use case
> > (including ad-hoc). Some typical distro-dependent scripting could be
> > simplified.
>
> I use it (well, 0.6.x) in ad-hoc mode all the time with the 'wext'
> driver and ipw2200 hardware. Seems like you shouldn't even be getting
> to this point though. The driver should be signalling association
> completed way before the timeout triggers. What driver was this again?
(The Socket P300 driver as I now read below). So the problem is
probably in the driver. The driver needs to send the WEXT association
event in *both* cases, either for association to an Infrastructure AP,
or when it starts/joins an IBSS as well. The BSSID sent along with the
event should include the BSSID that the driver just
associated/joined/started.
Run 'iwevent' when the supplicant tries to make the connection. You
should see something like:
09:44:31.634205 eth2 New Access Point/Cell address:00:1E:FE:EE:AA:BB
when the card sends the association event. Obviously, when joining an
IBSS, the "address" will be different (usually starting with 00:02:...).
If you don't see that event, the driver needs to be fixed.
Dan
> Dan
>
> > On 2/20/09, Shawn Rutledge <shawn.t.rutledge at gmail.com> wrote:
> > > For what it's worth, ad-hoc mode is working when I use the latest
> > > wpa_supplicant from git (calls itself 0.7.0). There were some fixes
> > > to the proprietary Socket P300 driver from Embwise... maybe that has
> > > something to do with it. My custom GUI sends something like
> > >
> > > SET_NETWORK 5 mode 1
> > >
> > > and so mode=1 gets put into the conf file. If wpa_gui is not yet
> > > doing the same thing, I still think it should.
> > >
> > _______________________________________________
> > HostAP mailing list
> > HostAP at lists.shmoo.com
> > http://lists.shmoo.com/mailman/listinfo/hostap
>
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
More information about the Hostap
mailing list