aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-11-17 07:34:04 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-18 17:09:18 -0500
commit15ff63653e507ec928a4a4386405a82446e096b1 (patch)
tree4e2ac0e39ab2142ae5115c4f1067e2962190e696 /net/mac80211/tx.c
parentd84f323477260e773d5317ad7cbe50f76115cb47 (diff)
mac80211: use fixed broadcast address
The netdev broadcast address cannot change from all-ones so there's no need to use it; we can instead hard-code it. Since we already have an instance in tkip.c, which will be shared if it is marked static const, doing this reduces text size at no data/bss cost. The real motivation for this is, of course, the desire to get rid of almost all uses of netdevs in mac80211 so that auditing their use becomes easier. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 375cecc837a1..3466e1f7fd12 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1683,21 +1683,25 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1683 /* packet from other interface */ 1683 /* packet from other interface */
1684 struct mesh_path *mppath; 1684 struct mesh_path *mppath;
1685 int is_mesh_mcast = 1; 1685 int is_mesh_mcast = 1;
1686 char *mesh_da; 1686 const u8 *mesh_da;
1687 1687
1688 rcu_read_lock(); 1688 rcu_read_lock();
1689 if (is_multicast_ether_addr(skb->data)) 1689 if (is_multicast_ether_addr(skb->data))
1690 /* DA TA mSA AE:SA */ 1690 /* DA TA mSA AE:SA */
1691 mesh_da = skb->data; 1691 mesh_da = skb->data;
1692 else { 1692 else {
1693 static const u8 bcast[ETH_ALEN] =
1694 { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
1695
1693 mppath = mpp_path_lookup(skb->data, sdata); 1696 mppath = mpp_path_lookup(skb->data, sdata);
1694 if (mppath) { 1697 if (mppath) {
1695 /* RA TA mDA mSA AE:DA SA */ 1698 /* RA TA mDA mSA AE:DA SA */
1696 mesh_da = mppath->mpp; 1699 mesh_da = mppath->mpp;
1697 is_mesh_mcast = 0; 1700 is_mesh_mcast = 0;
1698 } else 1701 } else {
1699 /* DA TA mSA AE:SA */ 1702 /* DA TA mSA AE:SA */
1700 mesh_da = dev->broadcast; 1703 mesh_da = bcast;
1704 }
1701 } 1705 }
1702 hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc, 1706 hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc,
1703 mesh_da, dev->dev_addr); 1707 mesh_da, dev->dev_addr);