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: 13277606 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C35A822D60 for ; Mon, 12 Jun 2023 21:37:11 +0000 (UTC) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77DD398 for ; Mon, 12 Jun 2023 14:37:10 -0700 (PDT) Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-75da00a1eddso33411585a.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=7gRUIdVe1sKZTLoeHDbNZTMhV3696nvM6bpQ9GoXUjY=; b=Pr2BclirY0OUkVQ/tmnNKv9NfMpDI09m6Z9+PURF/qWYNYHj96LzJDYGf/QkzEu1pJ pKZqJQc02/FSkkmLxU1nmLqQU35jRJS88novEL7MBRn41lbZq99UbK6oV8gKN8JFXtRj N2j2Ulf3Yq2cZpMojUf81hcpD7aQaQJe4+H+E= 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=7gRUIdVe1sKZTLoeHDbNZTMhV3696nvM6bpQ9GoXUjY=; b=iCEdAjSEOIc8UhmfE9Yc9ZSTVcAAyLXG9uMiIjEIVcnSGn5fC7NHkhY/RNbHL+5gJF AAHXlX9TslFSavA9u74pdLB77A3Q9z9Teb7aaZcbZsnpJ6our5eH3BTYOC1R5nKNMfh+ El/9FRjs34blRDXZDrMwuZReOf6K0bMhwTfX3vp4DXqmCjOLfxVs8OwH8dSXNIbPtg3S v8zqmOQa8FKBHuxI5U+yma5eIYo1AIz/Isl5Du9bm85+gj5oFAcZcy2NAYyZLBULCN8s mgMRREbXCenLCWoNemnwNtYnPQxSdsuQgKWxeXIjiMJnFLyt455d5/M5WZ9/VTjirBST mhaQ== X-Gm-Message-State: AC+VfDx9tca52mVTI+Ibd7BLERd3BtZ2WED8b3oG6wKUdvfmlNh9s8To Q+vQBnEiLYpvA6Sg0DxnlsN+ZHo6Hpjbloi0fUIY4ix0JZNXG82kzLQH2M6xqs9wS8eLsUaUMA0 39Prjv3oN49QVp/Lw6oGZYj6YVJQoSHrQvgLRNwjPWqt5zsKx+hV3K7vTPK8DuTjypYc4ODY01z pkdMo= X-Google-Smtp-Source: ACHHUZ4JRh+zVHthJlmj/CRe5Jv0qEm/uCe5B2gRbnHvDbm7uzFkiFcDZketiTL30zXgwUGBQHsxfg== 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 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-Patchwork-Delegate: kuba@kernel.org 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);