[PATCH] nl80211: Do not assume the device is rf-killed before trying to set it up

Peer, Ilan ilan.peer
Mon Apr 28 01:13:29 PDT 2014


Hi Tomasz,

> >> +		} else {
> >> +			wpa_printf(MSG_ERROR, "nl80211: Could not %s "
> >> +				   "interface '%s' UP",
> >> +				   nlmode == NL80211_IFTYPE_P2P_DEVICE ?
> >> +				   "start P2P" : "set", bss->ifname);
> >> +			return -1;
> > Can use "return ret;"
> 
> No need to, actually there is only one time the return code of
> wpa_driver_nl80211_finish_drv_init() is checked to be different than 0 and
> that's it. The ret variable is only used for the part below on which you have a
> comment.
> 

Ok. 

> >> +	if (nlmode == NL80211_IFTYPE_P2P_DEVICE) {
> >> +		nl80211_get_macaddr(bss);
> >> +		return ret;
> > Returning here is problematic as the wpa_driver_nl80211_send_rfkill() will
> not be called, and the INTERFACE_DISABLED event will not be fired.
> >
> 
> That logic was present before my patch and before Moshe's one.
> 
> So you mean we can continue here? Then there would be no need of ret
> variable at all.
> 

I mean that for this to work for P2P_DEVICE as well, the following logic needs to be called, otherwise, the wpa_s will not handle rfkill off properly.

if (send_rfkill_event) {
		eloop_register_timeout(0, 0, wpa_driver_nl80211_send_rfkill,
				       drv, drv->ctx);
}

Regards,

Ilan.



More information about the Hostap mailing list