mac80211: fix the support of setting non-forwarding entity in Mesh

RANN, PREP and PERR propagation should happen only if the
dot11MeshForwarding is true.  Besides, data frame should not be
forwarded if dot11MeshForwarding is false. This redundant checking
is necessary to avoid the broadcasted ARP breaking the non-forwarding
rule.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index f3b515d..c8166ad 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1960,6 +1960,9 @@
 		return RX_DROP_MONITOR;
 	}
 
+	if (!ifmsh->mshcfg.dot11MeshForwarding)
+		goto out;
+
 	fwd_skb = skb_copy(skb, GFP_ATOMIC);
 	if (!fwd_skb) {
 		if (net_ratelimit())