From patchwork Tue Aug 11 00:24:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Cardona X-Patchwork-Id: 40519 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7B0Zo6u004249 for ; Tue, 11 Aug 2009 00:35:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751319AbZHKAfr (ORCPT ); Mon, 10 Aug 2009 20:35:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751009AbZHKAfr (ORCPT ); Mon, 10 Aug 2009 20:35:47 -0400 Received: from wf-out-1314.google.com ([209.85.200.175]:64056 "EHLO wf-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750850AbZHKAfq (ORCPT ); Mon, 10 Aug 2009 20:35:46 -0400 Received: by wf-out-1314.google.com with SMTP id 26so1230603wfd.4 for ; Mon, 10 Aug 2009 17:35:47 -0700 (PDT) Received: by 10.142.222.19 with SMTP id u19mr318713wfg.70.1249950947843; Mon, 10 Aug 2009 17:35:47 -0700 (PDT) Received: from localhost (adsl-71-156-104-53.dsl.pltn13.sbcglobal.net [71.156.104.53]) by mx.google.com with ESMTPS id 30sm13725727wfd.23.2009.08.10.17.35.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 10 Aug 2009 17:35:47 -0700 (PDT) From: Javier Cardona To: linux-wireless@vger.kernel.org Cc: Javier Cardona , andrey@cozybit.com, johannes@sipsolutions.net, linville@tuxdriver.com, devel@lists.open80211s.org Subject: [PATCH] mac80211: Fix unresolved mesh frames queued without valid control.vif Date: Mon, 10 Aug 2009 17:24:20 -0700 Message-Id: <1249950260-26536-1-git-send-email-javier@cozybit.com> X-Mailer: git-send-email 1.5.4.3 In-Reply-To: <> References: <> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Mesh frames that could not be immediately resolved were queued with a NULL info->control.vif. This patch moves the call to mesh_nexthop_lookup closer to the point where it is handed over to ieee80211_tx(). This ensures that the unresolved frames are ready to be sent once the path is resolved. --- net/mac80211/tx.c | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index b9f5be6..56dc8df 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1413,14 +1413,7 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; - if (ieee80211_vif_is_mesh(&sdata->vif) && - ieee80211_is_data(hdr->frame_control)) { - if (!is_multicast_ether_addr(hdr->addr1)) - if (mesh_nexthop_lookup(skb, sdata)) { - dev_put(sdata->dev); - return; - } - } else if (unlikely(sdata->vif.type == NL80211_IFTYPE_MONITOR)) { + if (unlikely(sdata->vif.type == NL80211_IFTYPE_MONITOR)) { int hdrlen; u16 len_rthdr; @@ -1477,6 +1470,15 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, info->control.vif = &sdata->vif; + if (ieee80211_vif_is_mesh(&sdata->vif) && + ieee80211_is_data(hdr->frame_control) && + !is_multicast_ether_addr(hdr->addr1)) + if (mesh_nexthop_lookup(skb, sdata)) { + /* skb queued: don't free */ + dev_put(sdata->dev); + return; + } + ieee80211_select_queue(local, skb); ieee80211_tx(sdata, skb, false); dev_put(sdata->dev);