Bladeren bron

qcacld-3.0: Fix set all-zero address mcast filter

propagation from qcacld-2.0 to qcacld-3.0.

There are IPv4/IPv6 filters, we just use IPv4 filter for RXFILTER-ADD/REMOVE
now. Correctly update the filters from mc_addr_list.

Change-Id: I3457b206fe24e2484ec1f5a6240cbd0bc4a5825a
CRs-Fixed: 992500
Frank Liu 8 jaren geleden
bovenliggende
commit
f95e81359c
1 gewijzigde bestanden met toevoegingen van 7 en 5 verwijderingen
  1. 7 5
      core/hdd/src/wlan_hdd_ioctl.c

+ 7 - 5
core/hdd/src/wlan_hdd_ioctl.c

@@ -6449,7 +6449,7 @@ static int hdd_set_rx_filter(hdd_adapter_t *adapter, bool action,
 			uint8_t pattern)
 {
 	int ret;
-	uint8_t i;
+	uint8_t i, j;
 	tHalHandle handle;
 	tSirRcvFltMcAddrList *filter;
 	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
@@ -6487,19 +6487,21 @@ static int hdd_set_rx_filter(hdd_adapter_t *adapter, bool action,
 			return -ENOMEM;
 		}
 		filter->action = action;
-		for (i = 0; i < adapter->mc_addr_list.mc_cnt; i++) {
+		for (i = 0, j = 0; i < adapter->mc_addr_list.mc_cnt; i++) {
 			if (!memcmp(adapter->mc_addr_list.addr[i],
 				&pattern, 1)) {
-				memcpy(filter->multicastAddr[i].bytes,
+				memcpy(filter->multicastAddr[j].bytes,
 					adapter->mc_addr_list.addr[i],
 					sizeof(adapter->mc_addr_list.addr[i]));
-				filter->ulMulticastAddrCnt++;
+
 				hdd_info("%s RX filter : addr ="
 				    MAC_ADDRESS_STR,
 				    action ? "setting" : "clearing",
-				    MAC_ADDR_ARRAY(filter->multicastAddr[i].bytes));
+				    MAC_ADDR_ARRAY(filter->multicastAddr[j].bytes));
+				j++;
 			}
 		}
+		filter->ulMulticastAddrCnt = j;
 		/* Set rx filter */
 		sme_8023_multicast_list(handle, adapter->sessionId, filter);
 		qdf_mem_free(filter);