aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh_hwmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mesh_hwmp.c')
-rw-r--r--net/mac80211/mesh_hwmp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index ae82ea75bc74..4a993f2d1ae1 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -619,6 +619,7 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata,
619 struct ieee80211_mgmt *mgmt, 619 struct ieee80211_mgmt *mgmt,
620 u8 *prep_elem, u32 metric) 620 u8 *prep_elem, u32 metric)
621{ 621{
622 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
622 struct mesh_path *mpath; 623 struct mesh_path *mpath;
623 u8 *target_addr, *orig_addr; 624 u8 *target_addr, *orig_addr;
624 u8 ttl, hopcount, flags; 625 u8 ttl, hopcount, flags;
@@ -632,6 +633,9 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata,
632 /* destination, no forwarding required */ 633 /* destination, no forwarding required */
633 return; 634 return;
634 635
636 if (!ifmsh->mshcfg.dot11MeshForwarding)
637 return;
638
635 ttl = PREP_IE_TTL(prep_elem); 639 ttl = PREP_IE_TTL(prep_elem);
636 if (ttl <= 1) { 640 if (ttl <= 1) {
637 sdata->u.mesh.mshstats.dropped_frames_ttl++; 641 sdata->u.mesh.mshstats.dropped_frames_ttl++;
@@ -709,12 +713,15 @@ static void hwmp_perr_frame_process(struct ieee80211_sub_if_data *sdata,
709 mpath->flags &= ~MESH_PATH_ACTIVE; 713 mpath->flags &= ~MESH_PATH_ACTIVE;
710 mpath->sn = target_sn; 714 mpath->sn = target_sn;
711 spin_unlock_bh(&mpath->state_lock); 715 spin_unlock_bh(&mpath->state_lock);
716 if (!ifmsh->mshcfg.dot11MeshForwarding)
717 goto endperr;
712 mesh_path_error_tx(ttl, target_addr, cpu_to_le32(target_sn), 718 mesh_path_error_tx(ttl, target_addr, cpu_to_le32(target_sn),
713 cpu_to_le16(target_rcode), 719 cpu_to_le16(target_rcode),
714 broadcast_addr, sdata); 720 broadcast_addr, sdata);
715 } else 721 } else
716 spin_unlock_bh(&mpath->state_lock); 722 spin_unlock_bh(&mpath->state_lock);
717 } 723 }
724endperr:
718 rcu_read_unlock(); 725 rcu_read_unlock();
719} 726}
720 727
@@ -771,7 +778,7 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata,
771 mesh_queue_preq(mpath, PREQ_Q_F_START | PREQ_Q_F_REFRESH); 778 mesh_queue_preq(mpath, PREQ_Q_F_START | PREQ_Q_F_REFRESH);
772 } 779 }
773 780
774 if (mpath->sn < orig_sn) { 781 if (mpath->sn < orig_sn && ifmsh->mshcfg.dot11MeshForwarding) {
775 mesh_path_sel_frame_tx(MPATH_RANN, flags, orig_addr, 782 mesh_path_sel_frame_tx(MPATH_RANN, flags, orig_addr,
776 cpu_to_le32(orig_sn), 783 cpu_to_le32(orig_sn),
777 0, NULL, 0, broadcast_addr, 784 0, NULL, 0, broadcast_addr,