[03/12] nl80211: Allow off-channel of authentication frames in send_mlme()
diff mbox series

Message ID 20200224091437.15212-4-ilan.peer@intel.com
State Changes Requested
Headers show
Series
  • Preparations for Pre association Security Negotiation(PASN) Support
Related show

Commit Message

Peer, Ilan Feb. 24, 2020, 9:14 a.m. UTC
As part of the support needed for PASN.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 src/drivers/driver_nl80211.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Jouni Malinen Feb. 29, 2020, 9:13 p.m. UTC | #1
On Mon, Feb 24, 2020 at 11:14:28AM +0200, Ilan Peer wrote:
> As part of the support needed for PASN.

> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> @@ -3737,6 +3737,14 @@ static int wpa_driver_nl80211_send_mlme(struct i802_bss *bss, const u8 *data,
>  		   MAC2STR(mgmt->da), noack, freq, no_cck, offchanok, wait_time,
>  		   no_encrypt, fc, fc2str(fc), drv->nlmode);
>  
> +	if (is_sta_interface(drv->nlmode) &&
> +	    WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT &&
> +	    WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_AUTH) {
> +		return nl80211_send_frame_cmd(bss, freq, wait_time,
> +					      data, data_len, use_cookie, 1, noack,
> +					      1, csa_offs, csa_offs_len);
> +	}

Why would this ignore the no_cck and offchanok arguments from the caller
and replace these with hardcoded 1?

This seems to break SAE external authentication which needs the code
below to update freq from 0 to nl80211_get_assoc_freq() for the almost
identical nl80211_send_frame_cmd() call at the end of the function.

Why exactly is this change needed? Isn't the call at the end of the
function doing practically same for SAE Authentication frames without
breaking external authentication or ignoring no_cck/offchanok from the
caller?
Peer, Ilan March 1, 2020, 8:09 a.m. UTC | #2
> -----Original Message-----
> From: Jouni Malinen <j@w1.fi>
> Sent: Saturday, February 29, 2020 23:13
> To: Peer, Ilan <ilan.peer@intel.com>
> Cc: hostap@lists.infradead.org
> Subject: Re: [PATCH 03/12] nl80211: Allow off-channel of authentication
> frames in send_mlme()
> 
> On Mon, Feb 24, 2020 at 11:14:28AM +0200, Ilan Peer wrote:
> > As part of the support needed for PASN.
> 
> > diff --git a/src/drivers/driver_nl80211.c
> > b/src/drivers/driver_nl80211.c @@ -3737,6 +3737,14 @@ static int
> wpa_driver_nl80211_send_mlme(struct i802_bss *bss, const u8 *data,
> >  		   MAC2STR(mgmt->da), noack, freq, no_cck, offchanok,
> wait_time,
> >  		   no_encrypt, fc, fc2str(fc), drv->nlmode);
> >
> > +	if (is_sta_interface(drv->nlmode) &&
> > +	    WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT &&
> > +	    WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_AUTH) {
> > +		return nl80211_send_frame_cmd(bss, freq, wait_time,
> > +					      data, data_len, use_cookie, 1,
> noack,
> > +					      1, csa_offs, csa_offs_len);
> > +	}
> 
> Why would this ignore the no_cck and offchanok arguments from the caller
> and replace these with hardcoded 1?
> 
> This seems to break SAE external authentication which needs the code
> below to update freq from 0 to nl80211_get_assoc_freq() for the almost
> identical nl80211_send_frame_cmd() call at the end of the function.
> 
> Why exactly is this change needed? Isn't the call at the end of the function
> doing practically same for SAE Authentication frames without breaking
> external authentication or ignoring no_cck/offchanok from the caller?
> 

What was really needed here is the offchanok = 1. I'll rework the patch so offchanok would be set in
case external authentication.

Thanks,

Ilan.

Patch
diff mbox series

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 58b1265fe6..6d5284e0ef 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3737,6 +3737,14 @@  static int wpa_driver_nl80211_send_mlme(struct i802_bss *bss, const u8 *data,
 		   MAC2STR(mgmt->da), noack, freq, no_cck, offchanok, wait_time,
 		   no_encrypt, fc, fc2str(fc), drv->nlmode);
 
+	if (is_sta_interface(drv->nlmode) &&
+	    WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT &&
+	    WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_AUTH) {
+		return nl80211_send_frame_cmd(bss, freq, wait_time,
+					      data, data_len, use_cookie, 1, noack,
+					      1, csa_offs, csa_offs_len);
+	}
+
 	if ((is_sta_interface(drv->nlmode) ||
 	     drv->nlmode == NL80211_IFTYPE_P2P_DEVICE) &&
 	    WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT &&