Message ID | 20230712213934.586291-1-erik.r.karlsson@gmail.com |
---|---|
State | New |
Headers | show
Return-Path: <openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=<UNKNOWN>) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=O+vC3aWe; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=ENnwD6vN; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R1WTk4CQxz20bh for <incoming@patchwork.ozlabs.org>; Thu, 13 Jul 2023 07:44:08 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=rWLEJQCQ3mFfjCI0onqAaSy/HsGTJtsMcEUGgeKSbdI=; b=O+vC3aWeLteSMV /gPNiSnSiYqQR7kcyop//GQLeDOmadjiLvXyEdcsmvL/aOliMOlvAM5VeREW8n+Qt2nXqYZiJT62p n5Bahw0Av94v8nXLbORp8IloUEat6qOlVe5cWVwIR3x5+VxAZwafCrgk2RKRwhWzE6uJVy95fh4lf abnZyqJ76N/RcrrdnXihXEMXXEGJln7+B5P1YMLEU20FdXheTOvy/rKIQLgf8AoAE8dbFYpXKCqP/ pf7+x3VKFXCyDCRrmOu/HjpAQYzzVawv5eJ/AnyuQWt/0fIHkRBL6/OwRfe0MJq282d6BEuKMapb0 ldTkO33Zf6PsBD77bTLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJhaE-001KE4-1M; Wed, 12 Jul 2023 21:41:14 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJhaB-001KD1-0U for openwrt-devel@lists.openwrt.org; Wed, 12 Jul 2023 21:41:12 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2b6ff1ada5dso121453121fa.2 for <openwrt-devel@lists.openwrt.org>; Wed, 12 Jul 2023 14:41:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689198067; x=1691790067; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ET+A47/WtdmTwytkVjAUrsu7OG6UZeeiIA4ScM07kd4=; b=ENnwD6vNVMxx+aqbhVK9BjQ0hISy2sG4gijk1wbUUQNZ5jNLmfDUUOLPaa1HC+1YaK puQqL6dNvOF0eqxDnJ84h4kBJwaSMHQmntc8tmGPXEZLk5rnQxFlHvd7UpTjd0kYTN0t fWLLTu9r8VFAoi91TOyEWx+HCjxfyh5QJJTPniodnYE/1oRhmM+37B9BcRK5V2mHOe7c 96dJ8jkizGYAf7Q+6JqKot/yJW5bCMxR2vIpZcbnk3khQPxkH0tJgHcf1q/lpRKuHH0W zQDbssggtbQluPjVC9NcMzraKvsloHEPpj/7ldw13cdynHfTP2WY6FtibCVCXtCdPl53 AaCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689198067; x=1691790067; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ET+A47/WtdmTwytkVjAUrsu7OG6UZeeiIA4ScM07kd4=; b=hzWxJqvqDIbd1ADpn854XNBdHB5EdJAXNcKZUyMelkZtPupVS1CgM79XibA9KyLlAS jGIjHoUWhKIhDeXYTy0csK6bfL/uzz23xJ5OBawm4/g10MNMpErSlnloEGJpGHt2DTqg Pfa3rUswTMeUOg7pDbGmWV6wxubhd3CDp2ZK3AIVDkZNC/8G8naeMMGgPUuhv6dqV/9d qCPLs8ANmOtIFgfDejB7nLXbO9cwtg/ijgdbDS4Dx6GdOnUKzR2kYeXGsqGQbaEjBOLK 54QuAJADbItsVWQfWCoUTC8R9nRgshoYG34sd3trTNA1D2xgOO05fUT2zigvvfkGljxi gSPw== X-Gm-Message-State: ABy/qLajTmMwAyQcTtIvTXxy/G2iG9fAFkxljVrz/xlyG2bOiA2hkkbG OUg2b1faDXhhYhAuYscXije3Yjz1ndCJfQ== X-Google-Smtp-Source: APBJJlHUmWPjrN60hJFf1JOPUAUNzOxDigXFTB6Sp4SxqKSObbINzCVJVw8V/tIGhpMFwxhZ2ZttbA== X-Received: by 2002:a05:651c:211:b0:2b6:da64:321 with SMTP id y17-20020a05651c021100b002b6da640321mr16168285ljn.45.1689198066476; Wed, 12 Jul 2023 14:41:06 -0700 (PDT) Received: from se-pc-erik.genexislocal.nl (78-66-59-86-no600.tbcn.telia.com. [78.66.59.86]) by smtp.gmail.com with ESMTPSA id e5-20020a2e9e05000000b002b79b52deb3sm20519ljk.131.2023.07.12.14.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 14:41:05 -0700 (PDT) From: erik.r.karlsson@gmail.com To: openwrt-devel@lists.openwrt.org Cc: Erik Karlsson <erik.karlsson@genexis.eu> Subject: [PATCH netifd] device: restore cleared flags on device down Date: Wed, 12 Jul 2023 23:39:34 +0200 Message-Id: <20230712213934.586291-1-erik.r.karlsson@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230712_144111_207266_CD65E78C X-CRM114-Status: GOOD ( 10.11 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Erik Karlsson In case flags have been cleared because settings failed to apply, restore them when the device is brought down so that they will be re-attempted the next time the device is brought up. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:22c listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [erik.r.karlsson[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List <openwrt-devel.lists.openwrt.org> List-Unsubscribe: <https://lists.openwrt.org/mailman/options/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe> List-Archive: <http://lists.openwrt.org/pipermail/openwrt-devel/> List-Post: <mailto:openwrt-devel@lists.openwrt.org> List-Help: <mailto:openwrt-devel-request@lists.openwrt.org?subject=help> List-Subscribe: <https://lists.openwrt.org/mailman/listinfo/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "openwrt-devel" <openwrt-devel-bounces@lists.openwrt.org> Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org |
Series |
[netifd] device: restore cleared flags on device down
|
expand
|
diff --git a/device.c b/device.c index 92c814c..720b504 100644 --- a/device.c +++ b/device.c @@ -159,6 +159,11 @@ static int set_device_state(struct device *dev, bool state) } else { system_if_down(dev); system_if_apply_settings(dev, &dev->orig_settings, dev->orig_settings.flags); + + /* Restore any settings present in UCI which may have + * failed to apply so that they will be re-attempted + * the next time the device is brought up */ + dev->settings.flags |= dev->settings.valid_flags; } return 0; @@ -505,6 +510,10 @@ device_init_settings(struct device *dev, struct blob_attr **tb) s->duplex = blobmsg_get_bool(cur); s->flags |= DEV_OPT_DUPLEX; } + + /* Remember the settings present in UCI */ + s->valid_flags = s->flags; + device_set_extra_vlans(dev, tb[DEV_ATTR_VLAN]); device_set_disabled(dev, disabled); }