Commit 3c19065a authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[IEEE80211] ipw2200: Simplify multicast checks.

From: Stephen Hemminger <shemminger@osdl.org>

is_multicast_ether_addr() accepts broadcast too, so the
is_broadcast_ether_addr() calls are redundant.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 88df8ef5
...@@ -7456,8 +7456,7 @@ static void ipw_handle_data_packet(struct ipw_priv *priv, ...@@ -7456,8 +7456,7 @@ static void ipw_handle_data_packet(struct ipw_priv *priv,
/* HW decrypt will not clear the WEP bit, MIC, PN, etc. */ /* HW decrypt will not clear the WEP bit, MIC, PN, etc. */
hdr = (struct ieee80211_hdr_4addr *)rxb->skb->data; hdr = (struct ieee80211_hdr_4addr *)rxb->skb->data;
if (priv->ieee->iw_mode != IW_MODE_MONITOR && if (priv->ieee->iw_mode != IW_MODE_MONITOR &&
((is_multicast_ether_addr(hdr->addr1) || (is_multicast_ether_addr(hdr->addr1) ?
is_broadcast_ether_addr(hdr->addr1)) ?
!priv->ieee->host_mc_decrypt : !priv->ieee->host_decrypt)) !priv->ieee->host_mc_decrypt : !priv->ieee->host_decrypt))
ipw_rebuild_decrypted_skb(priv, rxb->skb); ipw_rebuild_decrypted_skb(priv, rxb->skb);
...@@ -7648,8 +7647,7 @@ static inline int is_network_packet(struct ipw_priv *priv, ...@@ -7648,8 +7647,7 @@ static inline int is_network_packet(struct ipw_priv *priv,
return 0; return 0;
/* {broad,multi}cast packets to our BSSID go through */ /* {broad,multi}cast packets to our BSSID go through */
if (is_multicast_ether_addr(header->addr1) || if (is_multicast_ether_addr(header->addr1))
is_broadcast_ether_addr(header->addr1))
return !memcmp(header->addr3, priv->bssid, ETH_ALEN); return !memcmp(header->addr3, priv->bssid, ETH_ALEN);
/* packets to our adapter go through */ /* packets to our adapter go through */
...@@ -7662,8 +7660,7 @@ static inline int is_network_packet(struct ipw_priv *priv, ...@@ -7662,8 +7660,7 @@ static inline int is_network_packet(struct ipw_priv *priv,
return 0; return 0;
/* {broad,multi}cast packets to our BSS go through */ /* {broad,multi}cast packets to our BSS go through */
if (is_multicast_ether_addr(header->addr1) || if (is_multicast_ether_addr(header->addr1))
is_broadcast_ether_addr(header->addr1))
return !memcmp(header->addr2, priv->bssid, ETH_ALEN); return !memcmp(header->addr2, priv->bssid, ETH_ALEN);
/* packets to our adapter go through */ /* packets to our adapter go through */
...@@ -9657,8 +9654,7 @@ static inline int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb, ...@@ -9657,8 +9654,7 @@ static inline int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
switch (priv->ieee->iw_mode) { switch (priv->ieee->iw_mode) {
case IW_MODE_ADHOC: case IW_MODE_ADHOC:
hdr_len = IEEE80211_3ADDR_LEN; hdr_len = IEEE80211_3ADDR_LEN;
unicast = !(is_multicast_ether_addr(hdr->addr1) || unicast = !is_multicast_ether_addr(hdr->addr1);
is_broadcast_ether_addr(hdr->addr1));
id = ipw_find_station(priv, hdr->addr1); id = ipw_find_station(priv, hdr->addr1);
if (id == IPW_INVALID_STATION) { if (id == IPW_INVALID_STATION) {
id = ipw_add_station(priv, hdr->addr1); id = ipw_add_station(priv, hdr->addr1);
...@@ -9673,8 +9669,7 @@ static inline int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb, ...@@ -9673,8 +9669,7 @@ static inline int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
case IW_MODE_INFRA: case IW_MODE_INFRA:
default: default:
unicast = !(is_multicast_ether_addr(hdr->addr3) || unicast = !is_multicast_ether_addr(hdr->addr3);
is_broadcast_ether_addr(hdr->addr3));
hdr_len = IEEE80211_3ADDR_LEN; hdr_len = IEEE80211_3ADDR_LEN;
id = 0; id = 0;
break; break;
......
...@@ -410,9 +410,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -410,9 +410,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
return 1; return 1;
} }
if ((is_multicast_ether_addr(hdr->addr1) || if (is_multicast_ether_addr(hdr->addr1)
is_broadcast_ether_addr(hdr->addr2)) ? ieee->host_mc_decrypt : ? ieee->host_mc_decrypt : ieee->host_decrypt) {
ieee->host_decrypt) {
int idx = 0; int idx = 0;
if (skb->len >= hdrlen + 3) if (skb->len >= hdrlen + 3)
idx = skb->data[hdrlen + 3] >> 6; idx = skb->data[hdrlen + 3] >> 6;
......
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