From patchwork Sat Oct 29 17:23:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 12759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439837wru; Sat, 29 Oct 2022 10:26:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7GcVCMlXYCA+M8m6/RofBDmqVenjqCuQMZ37QQiLxmEv0gCflUa8Bbu9tkZbK54cHTQuPd X-Received: by 2002:a17:902:e74e:b0:186:f3f4:f7fc with SMTP id p14-20020a170902e74e00b00186f3f4f7fcmr5310932plf.130.1667064394759; Sat, 29 Oct 2022 10:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064394; cv=none; d=google.com; s=arc-20160816; b=P+tBkiFJdW/18TrUOxHdUKwyo2rRSvq1fc4rVvpBWBp0yTULGwzvKXGRCmCm/lBZSj 8tApO9PHS/gAas877Sy2qzoJ/ETQfliOyfysI/T4XjNhM/GX6npi4Fz5XZvNAqAAq2aU IsIWt0AxjhJWYzkQqI1IMxPSrt5hlEB1vGdEUW/r+ysYDBIKpEhGfKhUROIR7OtHoU8R DPqRAf4TAgNdb37kE+wD+jdyFAzJ9i9Q9qT+F0hHLdjAUsq4VB3+PVkKOVKc/3D9vhQj glT7xVFF8jeRyzj28wriSLe3B4yP9Gm5v+mQQdyQ8DkxArVaXr+8BZ62/p/9pE3iTDiP u4hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=l8TujWbUaRSRTlTHOdwYiEYJpevuA130ZFpicQLK8Qo=; b=swcwlk8KRb5aaQaF+Vkzqb3G7szODdMonmiV/dyQ2WXpWPN9g08TYLPz3XCLqcKyJj X2IExKRs0GX/ejj+cEsiPNUKb6OofiD3UCW5HBNK14A+FfzmgR0duP4NrvQ2qxtZb+yK 8p9QJ3d9BH59HP1GIIDGUQtE4YpGCvqWu2GuApIuYo6DiGCK+kPxXtmyNjuld+iaTDSf Abam9uIXk4RIL4uEeQDUc8Dzx7bjbWcvrczsk6FsmiYY3kdo+wRUKdOKeizt/dIVe5cT rqXikxMpCUcL3c6VTIXM4jUXyhqnB91B4mgEirZwNfu4r/mdhngQk1R56YopLVQeOYVE V3pQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d19-20020a656b93000000b00454649777ddsi2253110pgw.601.2022.10.29.10.26.22; Sat, 29 Oct 2022 10:26:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229948AbiJ2RYb (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229877AbiJ2RYM (ORCPT ); Sat, 29 Oct 2022 13:24:12 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C54250F9C for ; Sat, 29 Oct 2022 10:24:04 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1oopYt-00074v-Jk; Sat, 29 Oct 2022 19:23:59 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 08/13] staging: r8188eu: replace GetAddr1Ptr call in OnAction_p2p Date: Sat, 29 Oct 2022 19:23:32 +0200 Message-Id: <20221029172337.1574593-9-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748043714333994078?= X-GMAIL-MSGID: =?utf-8?q?1748043714333994078?= Define a struct ieee80211_mgmt in OnAction_p2p and use it to check the destination address. This replaces a call to the driver-specific GetAddr1Ptr function. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 7b05f847a8e6..40539fa3b5a2 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3835,6 +3835,7 @@ static void on_action_public(struct adapter *padapter, struct recv_frame *precv_ static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) { + struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; u8 *frame_body; u8 OUI_Subtype; u8 *pframe = precv_frame->rx_data; @@ -3842,7 +3843,7 @@ static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_fram struct wifidirect_info *pwdinfo = &padapter->wdinfo; /* check RA matches or not */ - if (memcmp(myid(&padapter->eeprompriv), GetAddr1Ptr(pframe), ETH_ALEN))/* for if1, sta/ap mode */ + if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN))/* for if1, sta/ap mode */ return; frame_body = (unsigned char *)(pframe + sizeof(struct ieee80211_hdr_3addr));