Selaa lähdekoodia

qcacmn: Parse Extended MLD CAP & OP of ML IE

Include Extended MLD Capabilities & Operations subfield size
calculation in the calculation of Common Info Length of the
Basic Variant ML-IE parsing

Change-Id: I8fea9058dc37b7605827ef827a3ccba71be00982
CRs-Fixed: 3590364
Rakesh Boyina 1 vuosi sitten
vanhempi
sitoutus
f4b054cd11
2 muutettua tiedostoa jossa 28 lisäystä ja 1 poistoa
  1. 24 1
      umac/mlo_mgr/src/utils_mlo.c
  2. 4 0
      umac/scan/dispatcher/src/wlan_scan_utils_api.c

+ 24 - 1
umac/mlo_mgr/src/utils_mlo.c

@@ -228,8 +228,31 @@ util_parse_multi_link_ctrl(uint8_t *mlieseqpayload,
 		parsed_payload_len += WLAN_ML_BV_CINFO_MLDID_SIZE;
 	}
 
+	/* Check if Ext MLD CAP OP is present */
+	if (presence_bm & WLAN_ML_BV_CTRL_PBM_EXT_MLDCAPANDOP_P) {
+		if (mlieseqpayloadlen <
+				(parsed_payload_len +
+				 WLAN_ML_BV_CINFO_EXT_MLDCAPANDOP_SIZE)) {
+			mlo_err_rl("ML seq payload len %zu insufficient for Ext MLD CAP OP size %u after parsed payload len %zu.",
+				   mlieseqpayloadlen,
+				   WLAN_ML_BV_CINFO_EXT_MLDCAPANDOP_SIZE,
+				   parsed_payload_len);
+			return QDF_STATUS_E_PROTO;
+		}
+
+		parsed_payload_len += WLAN_ML_BV_CINFO_EXT_MLDCAPANDOP_SIZE;
+	}
+
 	exp_cinfo_len = parsed_payload_len - WLAN_ML_CTRL_SIZE;
-	if (cinfo_len != exp_cinfo_len) {
+	if (cinfo_len >= exp_cinfo_len) {
+		/* If common info length received is greater,
+		 *  skip through the additional bytes
+		 */
+		parsed_payload_len += (cinfo_len - exp_cinfo_len);
+		mlo_debug("ML seq common info len %u, parsed payload length %zu, expected common info len %u",
+			  cinfo_len, parsed_payload_len, exp_cinfo_len);
+	} else {
+		/* If cinfo_len < exp_cinfo_len return error */
 		mlo_err_rl("ML seq common info len %u doesn't match with expected common info len %u",
 			   cinfo_len, exp_cinfo_len);
 		return QDF_STATUS_E_PROTO;

+ 4 - 0
umac/scan/dispatcher/src/wlan_scan_utils_api.c

@@ -2158,6 +2158,10 @@ static uint8_t util_get_link_info_offset(uint8_t *ml_ie, bool *is_ml_ie_valid)
 	if (presencebm & WLAN_ML_BV_CTRL_PBM_MLDID_P)
 		parsed_ie_len += WLAN_ML_BV_CINFO_MLDID_SIZE;
 
+	/* Check if Extended MLD Cap and Op is present */
+	if (presencebm & WLAN_ML_BV_CTRL_PBM_EXT_MLDCAPANDOP_P)
+		parsed_ie_len += WLAN_ML_BV_CINFO_EXT_MLDCAPANDOP_SIZE;
+
 	/* Offset calculation starts from the beginning of the ML IE (including
 	 * EID) hence, adding the size of IE header to ML IE length.
 	 */