Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a71bf90f authored by Wei Yongjun's avatar Wei Yongjun Committed by John W. Linville
Browse files

mwifiex: use is_broadcast_ether_addr() instead of memcmp()



Using is_broadcast_ether_addr() instead of directly use
memcmp() to determine if the ethernet address is broadcast
address.

Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0d1c6d1c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -551,7 +551,6 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv,
	struct host_cmd_tlv_mac_addr *tlv_mac;
	u16 key_param_len = 0, cmd_size;
	int ret = 0;
	const u8 bc_mac[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };

	cmd->command = cpu_to_le16(HostCmd_CMD_802_11_KEY_MATERIAL);
	key_material->action = cpu_to_le16(cmd_action);
@@ -593,7 +592,7 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv,
			/* set 0 when re-key */
			key_material->key_param_set.key[1] = 0;

		if (0 != memcmp(enc_key->mac_addr, bc_mac, sizeof(bc_mac))) {
		if (!is_broadcast_ether_addr(enc_key->mac_addr)) {
			/* WAPI pairwise key: unicast */
			key_material->key_param_set.key_info |=
				cpu_to_le16(KEY_UNICAST);