Skip to content

Commit 09b1747

Browse files
jmberg-intellinvjw
authored andcommitted
mac80211: move mesh filter adjusting
Logically, the filter adjusting belongs with starting/stopping mesh, not interface up/down, so move it there. Tested-by: Javier Cardona <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
1 parent 45904f2 commit 09b1747

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

net/mac80211/iface.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,6 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
197197
sdata->bss = &sdata->u.ap;
198198
break;
199199
case NL80211_IFTYPE_MESH_POINT:
200-
if (!ieee80211_vif_is_mesh(&sdata->vif))
201-
break;
202-
/* mesh ifaces must set allmulti to forward mcast traffic */
203-
atomic_inc(&local->iff_allmultis);
204-
break;
205200
case NL80211_IFTYPE_STATION:
206201
case NL80211_IFTYPE_MONITOR:
207202
case NL80211_IFTYPE_ADHOC:
@@ -274,9 +269,6 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
274269
}
275270

276271
if (ieee80211_vif_is_mesh(&sdata->vif)) {
277-
local->fif_other_bss++;
278-
ieee80211_configure_filter(local);
279-
280272
ieee80211_start_mesh(sdata);
281273
} else if (sdata->vif.type == NL80211_IFTYPE_AP) {
282274
local->fif_pspoll++;
@@ -504,16 +496,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
504496
ieee80211_configure_filter(local);
505497
break;
506498
case NL80211_IFTYPE_MESH_POINT:
507-
if (ieee80211_vif_is_mesh(&sdata->vif)) {
508-
/* other_bss and allmulti are always set on mesh
509-
* ifaces */
510-
local->fif_other_bss--;
511-
atomic_dec(&local->iff_allmultis);
512-
513-
ieee80211_configure_filter(local);
514-
499+
if (ieee80211_vif_is_mesh(&sdata->vif))
515500
ieee80211_stop_mesh(sdata);
516-
}
517501
/* fall through */
518502
default:
519503
flush_work(&sdata->work);

net/mac80211/mesh.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,11 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
513513
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
514514
struct ieee80211_local *local = sdata->local;
515515

516+
local->fif_other_bss++;
517+
/* mesh ifaces must set allmulti to forward mcast traffic */
518+
atomic_inc(&local->iff_allmultis);
519+
ieee80211_configure_filter(local);
520+
516521
set_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags);
517522
ieee80211_mesh_root_setup(ifmsh);
518523
ieee80211_queue_work(&local->hw, &sdata->work);
@@ -524,6 +529,8 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
524529

525530
void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
526531
{
532+
struct ieee80211_local *local = sdata->local;
533+
527534
del_timer_sync(&sdata->u.mesh.housekeeping_timer);
528535
del_timer_sync(&sdata->u.mesh.mesh_path_root_timer);
529536
/*
@@ -534,6 +541,10 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
534541
* it no longer is.
535542
*/
536543
cancel_work_sync(&sdata->work);
544+
545+
local->fif_other_bss--;
546+
atomic_dec(&local->iff_allmultis);
547+
ieee80211_configure_filter(local);
537548
}
538549

539550
static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,

0 commit comments

Comments
 (0)