]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Set OCV capability based on Association Request frame RSNE
authorAleti Nageshwar Reddy <quic_anageshw@quicinc.com>
Mon, 23 Jan 2023 09:53:31 +0000 (15:23 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 25 Jan 2023 21:47:33 +0000 (23:47 +0200)
Currently, OCV self-capability is being set into the RSN supplicant
state machine only during the initial connection and never getting
updated. But for the driver-SME cases the driver may enable/disable OCV
in (Re)Association Request frame RSNE based on the AP chosen to roam.
This will lead to missing synchronization between wpa_supplicant and the
driver. Thus, update OCV self-capability in the wpa_supplicant RSN state
machine based on the (Re)Association Request frame RSNE indicated in the
connect response.

Signed-off-by: Aleti Nageshwar Reddy <quic_anageshw@quicinc.com>
wpa_supplicant/events.c

index 6f0ffa5b0e77917df07897e907494723e81b73e1..f85da5fa9644847f083b55fc38910d805f2164cb 100644 (file)
@@ -2844,8 +2844,10 @@ static int wpa_supplicant_use_own_rsne_params(struct wpa_supplicant *wpa_s,
                p += len;
        }
 
-       if (!found || wpa_parse_wpa_ie(p, len, &ie) < 0)
+       if (!found || wpa_parse_wpa_ie(p, len, &ie) < 0) {
+               wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_OCV, 0);
                return 0;
+       }
 
        wpa_hexdump(MSG_DEBUG,
                    "WPA: Update cipher suite selection based on IEs in driver-generated WPA/RSNE in AssocReq",
@@ -2872,6 +2874,11 @@ static int wpa_supplicant_use_own_rsne_params(struct wpa_supplicant *wpa_s,
                return -1;
        }
 
+       if (((wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME) ||
+            (wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_OCV)) && ssid->ocv)
+               wpa_sm_set_param(wpa_s->wpa, WPA_PARAM_OCV,
+                                !!(ie.capabilities & WPA_CAPABILITY_OCVC));
+
        /*
         * Update PMK in wpa_sm and the driver if roamed to WPA/WPA2 PSK from a
         * different AKM.