mac80211: don't return beacons when mesh is disabled
authorJohannes Berg <johannes.berg@intel.com>
Tue, 18 Jan 2011 12:45:32 +0000 (13:45 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 19 Jan 2011 16:36:11 +0000 (11:36 -0500)
When mesh is disabled, mac80211 was returning
beacons with an empty mesh ID. That isn't
desirable, even if drivers shouldn't be trying
to get beacons to start with.

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

index 2378305f7534498170151528d33c369f26326279..e46c801320e15991faafeb51c8dc04464fdab8d0 100644 (file)
@@ -2299,6 +2299,11 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
                struct ieee80211_mgmt *mgmt;
                u8 *pos;
 
+#ifdef CONFIG_MAC80211_MESH
+               if (!sdata->u.mesh.mesh_id_len)
+                       goto out;
+#endif
+
                /* headroom, head length, tail length and maximum TIM length */
                skb = dev_alloc_skb(local->tx_headroom + 400 +
                                sdata->u.mesh.vendor_ie_len);