From patchwork Fri May 3 02:33:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Pedersen X-Patchwork-Id: 2514831 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 368B3DF215 for ; Fri, 3 May 2013 02:36:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762056Ab3ECCgT (ORCPT ); Thu, 2 May 2013 22:36:19 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:59166 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756827Ab3ECCgS (ORCPT ); Thu, 2 May 2013 22:36:18 -0400 Received: by mail-pa0-f48.google.com with SMTP id kp6so673614pab.35 for ; Thu, 02 May 2013 19:36:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=JPwa72Uon09zEnfM9ZLflyCIYwRdVPGHuKnBDPT0rAM=; b=S3lr5ZCrhpixHoyXasWVtxoD0bCAzxjLpuKrsMlP84/Okz8kgkfKRBp3tuNTSioDb9 F90Tu3pWP0zEy41XU4yJXWzGTyuDjb1p54hpVTZKxDBEh1EPtgU2CNerX2o4XZrriGa9 GpdYMsL4hbZrn+BIBKXFIA8klm4mCV4Fbo9b/7S2kGWKdzWJ4LWY/iB0K25uveEd88xE gjlMjudD6QEKUnDRWLpZQt/lGf32rgdbMYJd0EiJOKsE0zws8SrSw/4qsfCp+YReLlkL PgtjE7weE+7ZVeAKL8vzVDwVOuXv9T3363u9OcAuh9OSKbkKg/bCYior3h4v7ivp0KJ6 e4Qg== X-Received: by 10.68.27.9 with SMTP id p9mr11535783pbg.139.1367548577339; Thu, 02 May 2013 19:36:17 -0700 (PDT) Received: from cable.lan (70-35-43-50.static.wiline.com. [70.35.43.50]) by mx.google.com with ESMTPSA id az5sm7391484pbc.18.2013.05.02.19.36.15 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 02 May 2013 19:36:16 -0700 (PDT) From: Thomas Pedersen To: Johannes Berg Cc: linux-wirelss , me@bobcopeland.com, open80211s , Thomas Pedersen Subject: [RFC 04/12] mac80211: assign outgoing interface with nexthop Date: Thu, 2 May 2013 19:33:54 -0700 Message-Id: <1367548442-8229-5-git-send-email-thomas@cozybit.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1367548442-8229-1-git-send-email-thomas@cozybit.com> References: <1367548442-8229-1-git-send-email-thomas@cozybit.com> X-Gm-Message-State: ALoCoQm/RxylZkLVEiVOG7yZmfWtCJdlv5Zv3jHnDvmqKaeKBKZ0an8+NnWBbDGAylgl2kf64Rom Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org When updated mpath routing info is found, the new route may be on a different interface (in the case of MBSS sharing). Signed-off-by: Thomas Pedersen --- net/mac80211/mesh_pathtbl.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index 993a270..7df8f27 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -195,27 +195,34 @@ static u32 mesh_table_hash(struct mesh_local_bss *mbss, const u8 *addr, /** * - * mesh_path_assign_nexthop - update mesh path next hop + * mesh_path_assign_nexthop - update mesh path info * * @mpath: mesh path to update * @sta: next hop to assign * + * Updates queued frames and outgoing interface. + * * Locking: mpath->state_lock must be held when calling this function */ void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta) { + struct ieee80211_sub_if_data *sdata = sta->sdata; + struct ieee80211_tx_info *info; struct sk_buff *skb; struct ieee80211_hdr *hdr; unsigned long flags; rcu_assign_pointer(mpath->next_hop, sta); + mpath->sdata = sdata; spin_lock_irqsave(&mpath->frame_queue.lock, flags); skb_queue_walk(&mpath->frame_queue, skb) { + info = IEEE80211_SKB_CB(skb); hdr = (struct ieee80211_hdr *) skb->data; memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN); - memcpy(hdr->addr2, mpath->sdata->vif.addr, ETH_ALEN); - ieee80211_mps_set_frame_flags(sta->sdata, sta, hdr); + memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN); + info->control.vif = &sdata->vif; + ieee80211_mps_set_frame_flags(sdata, sta, hdr); } spin_unlock_irqrestore(&mpath->frame_queue.lock, flags);