mac80211: reformat TX unauthorised check
authorJohannes Berg <johannes.berg@intel.com>
Wed, 12 Oct 2011 15:28:21 +0000 (17:28 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 14 Oct 2011 18:48:16 +0000 (14:48 -0400)
Reformat the check, the indentation is completely strange.
Also change the last part of the condition to make the
code shorter.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/tx.c

index 97ac2c4..48bbb96 100644 (file)
@@ -1896,11 +1896,10 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
         * Drop unicast frames to unauthorised stations unless they are
         * EAPOL frames from the local station.
         */
-       if (!ieee80211_vif_is_mesh(&sdata->vif) &&
-               unlikely(!is_multicast_ether_addr(hdr.addr1) && !authorized &&
-                     !(cpu_to_be16(ethertype) == sdata->control_port_protocol &&
-                      compare_ether_addr(sdata->vif.addr,
-                                         skb->data + ETH_ALEN) == 0))) {
+       if (unlikely(!ieee80211_vif_is_mesh(&sdata->vif) &&
+                    !is_multicast_ether_addr(hdr.addr1) && !authorized &&
+                    (cpu_to_be16(ethertype) != sdata->control_port_protocol ||
+                     compare_ether_addr(sdata->vif.addr, skb->data + ETH_ALEN)))) {
 #ifdef CONFIG_MAC80211_VERBOSE_DEBUG
                if (net_ratelimit())
                        printk(KERN_DEBUG "%s: dropped frame to %pM"