From patchwork Wed Aug 14 13:29:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Almbladh X-Patchwork-Id: 2844503 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 89C409F271 for ; Wed, 14 Aug 2013 13:30:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39D1E20514 for ; Wed, 14 Aug 2013 13:30:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C10E02050D for ; Wed, 14 Aug 2013 13:30:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758091Ab3HNNat (ORCPT ); Wed, 14 Aug 2013 09:30:49 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:50461 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757871Ab3HNNat (ORCPT ); Wed, 14 Aug 2013 09:30:49 -0400 Received: by mail-la0-f48.google.com with SMTP id er20so439792lab.21 for ; Wed, 14 Aug 2013 06:30:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=OzLQCN72DQumfnV59VWhyeDzABA+9DhdQVAyXLlK0B0=; b=YeMMncRsiAKt2lm3+I16GtzoO8ZS639WriFuroeH1i20G6giD4f9luVtG3qYW1DdgY V2km+8LoKQor4EuBrWsTrGF/K6VoQhDyj8wC8DCoVEYg6vTnXO8n4x5prh7+5El4Imnm ejqMJDaAFFNR9awgGZ7xRyQiMmtlC+fcRF0Ixj5cUXSc7qxpJegisBTXuWLvVDXdNUaJ 6bufwbqJyLmI55FvZOuPRZy3dPXIaCNO6vWmNrxlR54qgzPstAAKFITPKl9VaI26r7Gf xVNyM1Rl/TAL29k4DZnZPltNVOFEOYSvpcEkHB0LNzxIltn9dW6ZXJ+yRRc/b6ztml3q sW8Q== X-Gm-Message-State: ALoCoQnMfkFgr8k9e+p3zG/VCOKHuNFlQScG+UiNI/cx1oWE7sXEqfq6mRn9xWtno7LrnmY8DdNl X-Received: by 10.152.2.201 with SMTP id 9mr8605869law.20.1376487045848; Wed, 14 Aug 2013 06:30:45 -0700 (PDT) Received: from localhost.localdomain ([82.99.7.230]) by mx.google.com with ESMTPSA id l10sm15883220lbh.13.2013.08.14.06.30.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Aug 2013 06:30:45 -0700 (PDT) From: Johan Almbladh To: johannes@sipsolutions.net Cc: ordex@autistici.org, linux-wireless@vger.kernel.org, Johan Almbladh Subject: [PATCHv2 1/2] mac80211: perform power save processing before decryption Date: Wed, 14 Aug 2013 15:29:46 +0200 Message-Id: <1376486987-23224-1-git-send-email-ja@anyfi.net> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1376323275.11514.26.camel@jlt4.sipsolutions.net> References: <1376323275.11514.26.camel@jlt4.sipsolutions.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch decouples the power save processing from the frame decryption by running the decrypt rx handler after sta_process. In the case where the decryption failed for some reason, the stack used to not process the PM and MOREDATA bits for that frame. The stack now always performs power save processing regardless of the decryption result. That means that encrypted data frames and NULLFUNC frames are now handled in the same way regarding power save processing, making the stack more robust. Tested-by: Johan Almbladh Signed-off-by: Johan Almbladh --- net/mac80211/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 6b85f95..0f0017d 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -2939,10 +2939,10 @@ static void ieee80211_rx_handlers(struct ieee80211_rx_data *rx, */ rx->skb = skb; - CALL_RXH(ieee80211_rx_h_decrypt) CALL_RXH(ieee80211_rx_h_check_more_data) CALL_RXH(ieee80211_rx_h_uapsd_and_pspoll) CALL_RXH(ieee80211_rx_h_sta_process) + CALL_RXH(ieee80211_rx_h_decrypt) CALL_RXH(ieee80211_rx_h_defragment) CALL_RXH(ieee80211_rx_h_michael_mic_verify) /* must be after MMIC verify so header is counted in MPDU mic */