From patchwork Mon Jun 12 21:37:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Chen X-Patchwork-Id: 106906 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp154650vqr; Mon, 12 Jun 2023 14:58:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4N9BqdnIh13UbImMsi6V8ziY026ES3guHioE2RdLqj1cwv59+8Inx2+Exn2zNX6DC6ENZv X-Received: by 2002:a17:907:6e08:b0:978:6c50:dde5 with SMTP id sd8-20020a1709076e0800b009786c50dde5mr10361557ejc.36.1686607096812; Mon, 12 Jun 2023 14:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686607096; cv=none; d=google.com; s=arc-20160816; b=iFuKv1ZhqpFghIHYaw5yg0cgXTjdfCLkc87TzgOTkP85Ww2QeBiKTAZXNKjccJAkGA 4tIYE1KD9az/L+7y10vLUNB7Q6UJjFyk1Miig3UmtNPvh3cjlPtTP4+9eianMgXbIfGs NS/P32x17JnULyv7zQYkK0VvEBmqvdgjnCbnkvs1KioZtKn//2yCaj1KQHhfnSgwd4Uu wH1G0a5fhQuhTtEM5OC3po9PHgrPQE1uigMvsvOYq88bpankVT2/14k0k9waEE1qLREP RlrPBsKC9oiPbFFyy5GwiezEft/GakzD8y/+htlEoWTtjo1wiegA9ZMWUwX0MeRU4aVH d4gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=aSdrnuMshC/4W1nW87NbjCUKCl0KaAun1ATAheUZGcw=; b=dAI2lgKCd9NqW9BUtUE8fbt1AMznzzQijDGrlOFOH8d9tlSmZfHzpjXGITEMIXb2Nz UxUJ/6n64cTgIvNL5deFkLS+pbnBZ49DjHGGBS+0G2bcJct1fkZBz+tvdmGe1YMs5LH+ q7zvTwXI2Vqg5eGAtGMuXdBMWHEcjWALqBDrkjLNy5RDG06LovFPRK+T4e6f6qHhy7xu ojPTnpBO+BLl2e/iDBqS0tzTN/u2ol/RHXxnbfk5ug+ZQJ5UbUdV91ULaER630xu+ZXN kB4VwF4/aaRK5OMJ8RC/vbVsh1PrVIF7/7Ik2HpWX4Nh2x4Dk8Wd2g/9IXpKOgRQGeRg U92w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=SqGCBzLt; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y20-20020a170906471400b0097e2a90d223si3992008ejq.720.2023.06.12.14.57.52; Mon, 12 Jun 2023 14:58:16 -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; dkim=pass header.i=@broadcom.com header.s=google header.b=SqGCBzLt; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237269AbjFLVhM (ORCPT + 99 others); Mon, 12 Jun 2023 17:37:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbjFLVhK (ORCPT ); Mon, 12 Jun 2023 17:37:10 -0400 Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 330BF90 for ; Mon, 12 Jun 2023 14:37:10 -0700 (PDT) Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-62de3360ce8so2610056d6.3 for ; Mon, 12 Jun 2023 14:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686605829; x=1689197829; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aSdrnuMshC/4W1nW87NbjCUKCl0KaAun1ATAheUZGcw=; b=SqGCBzLt9n6ZmfEVUMJQSuvSgGSq0VWX0vwhPIgWEchaEOwXr3c55/waqECc6wHQWx HpBFJPurJkPPTHvLU2grOl4wmB46akc9G6BVjK845rp0D7KARXznU8x2X7zUKeaJLz94 DZEPk7Uli2sPvQJlf3gJgwKmwkP5cWxeOm5uc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686605829; x=1689197829; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aSdrnuMshC/4W1nW87NbjCUKCl0KaAun1ATAheUZGcw=; b=NX4CV6P6eNLkom5MY8ILXqsqoSSwFjl7uLcTvXMydnpxZ33HSu0VoATGg7kehI/Hz1 2ZtsRqYT7t+TeFR8X355fQtPkxQ7xBZ6oSPNCYPE/VUM8xIZgGHrHhmIsBMfsWYGp55A DYhJOdZiH8sYwIMMNaFIJyjYEphjfdqt5w/eGdHuGH1FE1zhL/iupphs4pyPbPAdybk0 arH+QLHZsDtk4t2KhMMo80pbifZLIXjlIz1zL5Pop3ugW9vnRuR7b6s33p9v/Nd3CzjS Sj7oYP0xLGkUzkwKJ9Pll642fH2NWI71ABP7rWTELESGhy5ADoH66MwkaRFHYzozY6zM fU7g== X-Gm-Message-State: AC+VfDzww4riHGch/piplA3oZ3rlEpLV1olKmSxcJubawF0ZPMpSG4u1 qstUa/3c9YPkrf0oY1Zatsp7XQ== X-Received: by 2002:a05:6214:488:b0:62d:e946:518c with SMTP id pt8-20020a056214048800b0062de946518cmr6802933qvb.56.1686605829230; Mon, 12 Jun 2023 14:37:09 -0700 (PDT) Received: from stbirv-lnx-2.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id c17-20020a0ce651000000b00621268e14efsm3496429qvn.55.2023.06.12.14.37.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2023 14:37:08 -0700 (PDT) From: Justin Chen To: netdev@vger.kernel.org Cc: bcm-kernel-feedback-list@broadcom.com, Justin Chen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Daniil Tatianin , Marco Bonelli , Vincent Mailhol , Maxim Korotkov , Gal Pressman , Jiri Pirko , Kuniyuki Iwashima , Simon Horman , Florian Fainelli , linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next] ethtool: ioctl: account for sopass diff in set_wol Date: Mon, 12 Jun 2023 14:37:00 -0700 Message-Id: <1686605822-34544-1-git-send-email-justin.chen@broadcom.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, MIME_HEADER_CTYPE_ONLY,MIME_NO_TEXT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,T_TVD_MIME_NO_HEADERS autolearn=no 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?1768535723119718965?= X-GMAIL-MSGID: =?utf-8?q?1768535723119718965?= sopass won't be set if wolopt doesn't change. This means the following will fail to set the correct sopass. ethtool -s eth0 wol s sopass 11:22:33:44:55:66 ethtool -s eth0 wol s sopass 22:44:55:66:77:88 Make sure we call into the driver layer set_wol if sopass is different. Fixes: 55b24334c0f2 ("ethtool: ioctl: improve error checking for set_wol") Signed-off-by: Justin Chen --- Note: Tagged "Fixes" patch has not hit rc yet. net/ethtool/ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ethtool/ioctl.c b/net/ethtool/ioctl.c index 37b582225854..4a51e0ec295c 100644 --- a/net/ethtool/ioctl.c +++ b/net/ethtool/ioctl.c @@ -1452,7 +1452,8 @@ static int ethtool_set_wol(struct net_device *dev, char __user *useraddr) if (wol.wolopts & ~cur_wol.supported) return -EINVAL; - if (wol.wolopts == cur_wol.wolopts) + if (wol.wolopts == cur_wol.wolopts && + !memcmp(wol.sopass, cur_wol.sopass, sizeof(wol.sopass))) return 0; ret = dev->ethtool_ops->set_wol(dev, &wol);