From patchwork Wed Oct 24 19:43:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Cardona X-Patchwork-Id: 1640331 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5FBF53FCF7 for ; Wed, 24 Oct 2012 19:44:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161030Ab2JXTor (ORCPT ); Wed, 24 Oct 2012 15:44:47 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:34457 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935433Ab2JXTnj (ORCPT ); Wed, 24 Oct 2012 15:43:39 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr4so1439666pbb.19 for ; Wed, 24 Oct 2012 12:43:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=mFtdNtrUR4XpkkAX28CjeKXwUs1VrJMQfMA+skPUVIE=; b=GixlTB0vgzWwIR9d8CfSAD9cxSKcRR3KJ7PtrFana+Q2hgU4fSbe/hu20zCzOMyVZp /1ooYXrEdiM9VylLPM1Fs+LMBWlaptpVMY9Ez8GFRYDezjZf9COiKv9OKQ3wQwUrNnJp 1yYNYIqmz9Ojvcbw7pleAcsg25/PsV7u1inN5LfJsgt69ptYFLsY3q768FRzdpyJMYlQ Ie84PCO8waTvw3EWnsOMNI5jvZcX+Wv9h2INYY4qO1bzbJt9f1JoeyrWhF4Wvq9yP4z2 8NeRKuCKxWxIZ8ZzRDlnkJwKZkkGD2fVWyCEs9eqd7uMlQaUI1faWDfHgkpozxaQ7MMf 9ZNg== Received: by 10.68.130.198 with SMTP id og6mr52531306pbb.163.1351107819061; Wed, 24 Oct 2012 12:43:39 -0700 (PDT) Received: from localhost.localdomain (70-35-43-50.static.wiline.com. [70.35.43.50]) by mx.google.com with ESMTPS id qn1sm9883443pbc.55.2012.10.24.12.43.37 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 24 Oct 2012 12:43:38 -0700 (PDT) From: Javier Cardona To: linville@tuxdriver.com Cc: Javier Cardona , linux-wireless@vger.kernel.org, devel@lists.open80211s.org, johannes@sipsolutions.net Subject: [PATCH 1/2] mac80211: Only process mesh config header on frames that RA_MATCH Date: Wed, 24 Oct 2012 12:43:30 -0700 Message-Id: <1351107811-6661-1-git-send-email-javier@cozybit.com> X-Mailer: git-send-email 1.7.5.4 X-Gm-Message-State: ALoCoQn3hRmdTwRMc8I5mPf9pjLsp5lj9oe+1p9zeGykS08BUkZXfzW5Tvkfg4a939bjyAmPKdpx Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Doing otherwise is wrong, and may wreak havoc on the mpp tables, specially if the frame is encrypted. Reported-by: Chaoxing Lin Signed-off-by: Javier Cardona --- net/mac80211/rx.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 61c621e..1222127 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -1897,7 +1897,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) mesh_rmc_check(hdr->addr3, mesh_hdr, rx->sdata)) return RX_DROP_MONITOR; - if (!ieee80211_is_data(hdr->frame_control)) + if (!ieee80211_is_data(hdr->frame_control) || + !(status->rx_flags & IEEE80211_RX_RA_MATCH)) return RX_CONTINUE; if (!mesh_hdr->ttl) @@ -1941,9 +1942,6 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) } skb_set_queue_mapping(skb, q); - if (!(status->rx_flags & IEEE80211_RX_RA_MATCH)) - goto out; - if (!--mesh_hdr->ttl) { IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl); return RX_DROP_MONITOR;