summaryrefslogtreecommitdiffstats
path: root/net/mac80211/iface.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2015-04-22 08:40:58 -0400
committerJohannes Berg <johannes.berg@intel.com>2015-04-24 05:14:13 -0400
commitdf1404650ccbfeb76a84f301f22316be0d00a864 (patch)
tree3c866bf75c99dd402b4e152bdeefaa209f38eb8d /net/mac80211/iface.c
parentebd82b39bf11b38b0b50919c8d4386706b26bff7 (diff)
mac80211: remove support for IFF_PROMISC
This support is essentially useless as typically networks are encrypted, frames will be filtered by hardware, and rate scaling will be done with the intended recipient in mind. For real monitoring of the network, the monitor mode support should be used instead. Removing it removes a lot of corner cases. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r--net/mac80211/iface.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index b4ac596a7cb7..7791a08a560a 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -697,9 +697,6 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
697 if (sdata->flags & IEEE80211_SDATA_ALLMULTI) 697 if (sdata->flags & IEEE80211_SDATA_ALLMULTI)
698 atomic_inc(&local->iff_allmultis); 698 atomic_inc(&local->iff_allmultis);
699 699
700 if (sdata->flags & IEEE80211_SDATA_PROMISC)
701 atomic_inc(&local->iff_promiscs);
702
703 if (coming_up) 700 if (coming_up)
704 local->open_count++; 701 local->open_count++;
705 702
@@ -827,13 +824,10 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
827 WARN_ON_ONCE((sdata->vif.type != NL80211_IFTYPE_WDS && flushed > 0) || 824 WARN_ON_ONCE((sdata->vif.type != NL80211_IFTYPE_WDS && flushed > 0) ||
828 (sdata->vif.type == NL80211_IFTYPE_WDS && flushed != 1)); 825 (sdata->vif.type == NL80211_IFTYPE_WDS && flushed != 1));
829 826
830 /* don't count this interface for promisc/allmulti while it is down */ 827 /* don't count this interface for allmulti while it is down */
831 if (sdata->flags & IEEE80211_SDATA_ALLMULTI) 828 if (sdata->flags & IEEE80211_SDATA_ALLMULTI)
832 atomic_dec(&local->iff_allmultis); 829 atomic_dec(&local->iff_allmultis);
833 830
834 if (sdata->flags & IEEE80211_SDATA_PROMISC)
835 atomic_dec(&local->iff_promiscs);
836
837 if (sdata->vif.type == NL80211_IFTYPE_AP) { 831 if (sdata->vif.type == NL80211_IFTYPE_AP) {
838 local->fif_pspoll--; 832 local->fif_pspoll--;
839 local->fif_probe_req--; 833 local->fif_probe_req--;
@@ -1047,12 +1041,10 @@ static void ieee80211_set_multicast_list(struct net_device *dev)
1047{ 1041{
1048 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1042 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1049 struct ieee80211_local *local = sdata->local; 1043 struct ieee80211_local *local = sdata->local;
1050 int allmulti, promisc, sdata_allmulti, sdata_promisc; 1044 int allmulti, sdata_allmulti;
1051 1045
1052 allmulti = !!(dev->flags & IFF_ALLMULTI); 1046 allmulti = !!(dev->flags & IFF_ALLMULTI);
1053 promisc = !!(dev->flags & IFF_PROMISC);
1054 sdata_allmulti = !!(sdata->flags & IEEE80211_SDATA_ALLMULTI); 1047 sdata_allmulti = !!(sdata->flags & IEEE80211_SDATA_ALLMULTI);
1055 sdata_promisc = !!(sdata->flags & IEEE80211_SDATA_PROMISC);
1056 1048
1057 if (allmulti != sdata_allmulti) { 1049 if (allmulti != sdata_allmulti) {
1058 if (dev->flags & IFF_ALLMULTI) 1050 if (dev->flags & IFF_ALLMULTI)
@@ -1062,13 +1054,6 @@ static void ieee80211_set_multicast_list(struct net_device *dev)
1062 sdata->flags ^= IEEE80211_SDATA_ALLMULTI; 1054 sdata->flags ^= IEEE80211_SDATA_ALLMULTI;
1063 } 1055 }
1064 1056
1065 if (promisc != sdata_promisc) {
1066 if (dev->flags & IFF_PROMISC)
1067 atomic_inc(&local->iff_promiscs);
1068 else
1069 atomic_dec(&local->iff_promiscs);
1070 sdata->flags ^= IEEE80211_SDATA_PROMISC;
1071 }
1072 spin_lock_bh(&local->filter_lock); 1057 spin_lock_bh(&local->filter_lock);
1073 __hw_addr_sync(&local->mc_list, &dev->mc, dev->addr_len); 1058 __hw_addr_sync(&local->mc_list, &dev->mc, dev->addr_len);
1074 spin_unlock_bh(&local->filter_lock); 1059 spin_unlock_bh(&local->filter_lock);