Commit cc2db7cb authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: ioctl_cfg80211.c: Use ether_addr_equal()

... and in one case use is_zero_ether_addr()
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 888df442
...@@ -1258,7 +1258,7 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy, ...@@ -1258,7 +1258,7 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,
check_fwstate(pmlmepriv, _FW_LINKED)) { check_fwstate(pmlmepriv, _FW_LINKED)) {
struct wlan_network *cur_network = &pmlmepriv->cur_network; struct wlan_network *cur_network = &pmlmepriv->cur_network;
if (memcmp(mac, cur_network->network.MacAddress, ETH_ALEN)) { if (!ether_addr_equal(mac, cur_network->network.MacAddress)) {
DBG_8723A("%s, mismatch bssid =" MAC_FMT "\n", __func__, DBG_8723A("%s, mismatch bssid =" MAC_FMT "\n", __func__,
MAC_ARG(cur_network->network.MacAddress)); MAC_ARG(cur_network->network.MacAddress));
ret = -ENOENT; ret = -ENOENT;
...@@ -2068,8 +2068,8 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, ...@@ -2068,8 +2068,8 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
dst_bssid = pnetwork->network.MacAddress; dst_bssid = pnetwork->network.MacAddress;
if (sme->bssid) { if (sme->bssid) {
if (memcmp(pnetwork->network.MacAddress, if (!ether_addr_equal(pnetwork->network.MacAddress,
sme->bssid, ETH_ALEN)) sme->bssid))
continue; continue;
} }
...@@ -2083,7 +2083,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, ...@@ -2083,7 +2083,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
if (sme->bssid) { if (sme->bssid) {
src_bssid = sme->bssid; src_bssid = sme->bssid;
if ((!memcmp(dst_bssid, src_bssid, ETH_ALEN))) { if (ether_addr_equal(dst_bssid, src_bssid)) {
DBG_8723A("matched by bssid\n"); DBG_8723A("matched by bssid\n");
ndis_ssid.ssid_len = ndis_ssid.ssid_len =
...@@ -2307,20 +2307,18 @@ static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy, ...@@ -2307,20 +2307,18 @@ static int cfg80211_rtw_set_pmksa(struct wiphy *wiphy,
u8 index, blInserted = false; u8 index, blInserted = false;
struct rtw_adapter *padapter = wiphy_to_adapter(wiphy); struct rtw_adapter *padapter = wiphy_to_adapter(wiphy);
struct security_priv *psecuritypriv = &padapter->securitypriv; struct security_priv *psecuritypriv = &padapter->securitypriv;
u8 strZeroMacAddress[ETH_ALEN] = { 0x00 };
DBG_8723A("%s(%s)\n", __func__, netdev->name); DBG_8723A("%s(%s)\n", __func__, netdev->name);
if (!memcmp(pmksa->bssid, strZeroMacAddress, ETH_ALEN)) { if (is_zero_ether_addr(pmksa->bssid))
return -EINVAL; return -EINVAL;
}
blInserted = false; blInserted = false;
/* overwrite PMKID */ /* overwrite PMKID */
for (index = 0; index < NUM_PMKID_CACHE; index++) { for (index = 0; index < NUM_PMKID_CACHE; index++) {
if (!memcmp(psecuritypriv->PMKIDList[index].Bssid, if (ether_addr_equal(psecuritypriv->PMKIDList[index].Bssid,
pmksa->bssid, ETH_ALEN)) { pmksa->bssid)) {
/* BSSID is matched, the same AP => rewrite with /* BSSID is matched, the same AP => rewrite with
new PMKID. */ new PMKID. */
DBG_8723A("%s(%s): BSSID exists in the PMKList.\n", DBG_8723A("%s(%s): BSSID exists in the PMKList.\n",
...@@ -2368,9 +2366,10 @@ static int cfg80211_rtw_del_pmksa(struct wiphy *wiphy, ...@@ -2368,9 +2366,10 @@ static int cfg80211_rtw_del_pmksa(struct wiphy *wiphy,
DBG_8723A("%s(%s)\n", __func__, netdev->name); DBG_8723A("%s(%s)\n", __func__, netdev->name);
for (index = 0; index < NUM_PMKID_CACHE; index++) { for (index = 0; index < NUM_PMKID_CACHE; index++) {
if (!memcmp(psecuritypriv->PMKIDList[index].Bssid, if (ether_addr_equal(psecuritypriv->PMKIDList[index].Bssid,
pmksa->bssid, ETH_ALEN)) { pmksa->bssid)) {
/* BSSID is matched, the same AP => Remove this PMKID information and reset it. */ /* BSSID is matched, the same AP => Remove this PMKID
information and reset it. */
eth_zero_addr(psecuritypriv->PMKIDList[index].Bssid); eth_zero_addr(psecuritypriv->PMKIDList[index].Bssid);
memset(psecuritypriv->PMKIDList[index].PMKID, 0x00, memset(psecuritypriv->PMKIDList[index].PMKID, 0x00,
WLAN_PMKID_LEN); WLAN_PMKID_LEN);
...@@ -2961,7 +2960,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, ...@@ -2961,7 +2960,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy,
list_for_each_safe(plist, ptmp, phead) { list_for_each_safe(plist, ptmp, phead) {
psta = container_of(plist, struct sta_info, asoc_list); psta = container_of(plist, struct sta_info, asoc_list);
if (!memcmp(mac, psta->hwaddr, ETH_ALEN)) { if (ether_addr_equal(mac, psta->hwaddr)) {
if (psta->dot8021xalg == 1 && if (psta->dot8021xalg == 1 &&
psta->bpairwise_key_installed == false) { psta->bpairwise_key_installed == false) {
DBG_8723A("%s, sta's dot8021xalg = 1 and " DBG_8723A("%s, sta's dot8021xalg = 1 and "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment