Message ID | 20231016165740.1374614-11-stefano.babic@swupdate.org |
---|---|
State | Changes Requested |
Delegated to: | Stefano Babic |
Headers | show
Return-Path: <swupdate+bncBAABBCWXWWUQMGQEGFGQ6DA@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=TIMitlYr; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::33f; helo=mail-wm1-x33f.google.com; envelope-from=swupdate+bncbaabbcwxwwuqmgqegfgq6da@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-wm1-x33f.google.com (mail-wm1-x33f.google.com [IPv6:2a00:1450:4864:20::33f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4S8Nb432mYz26jR for <incoming@patchwork.ozlabs.org>; Tue, 17 Oct 2023 03:57:51 +1100 (AEDT) Received: by mail-wm1-x33f.google.com with SMTP id 5b1f17b1804b1-3f41a04a297sf36371025e9.3 for <incoming@patchwork.ozlabs.org>; Mon, 16 Oct 2023 09:57:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697475467; cv=pass; d=google.com; s=arc-20160816; b=VRq5EkLvtyoNtzaCqBDil2moD5dL76lmq8XJ+0I4m4X6+cCvflr4DHSGSdK9QjnLhC K9y5gMyO9NW6WR+70IsY1KqH/XgUcEn5jS2V417lFEbVdVU13Z7HfrQFWdlfHH2BM5Oj FTAy47rz7LSSDpX5sNhX1uSDtgp0oPSkyEE+ZRv4P8N9xJQRcAsr8kp2YRO9B7wFBfud 9BiKJERXCuFGzKcpDGxkpcBvrTv7d/jCVoJsrVRYlld07awg1RUM8HyKQrfYBoZy10lI Q32+BC6472o/r1N6XWTlZU4e3RuK514iMDx/xgnCKnPg3PpyLsMlfgE7DcypO45QFNV8 MCYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:ui-outboundreport:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=TnLODCPET39yJ49gGAx+nEjWodMYeQYNLRBv3wsPgtc=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=EE8bIrXcNrPT5xnZXvtuTb3fs/yZoX+US7IUkz+UIc93D+mtdlGyiozMy/cO/6Z2T8 7oyZeLdz9/SG6X1pL7DxZSKfZwIFj4r3jow2xJuMXMCUNPrJs8VDJbxGpZY2ifZCq7ch fQ7/qnJa/JtDr55YTnqCHh1ESISrHYPJWcP1CgsIQ8Wsn6o0cLs+S7EcjGoVRbMH7Wp4 DzwGh2asrjD9Qlq7sQE30aSQjw7EuqD7EwPdbp0iZVY4X0BpMVD3L8GyZie67WJzKUuP T2zBur2mnTvyKC011Q4KM+KdGi7wgKQf+XKXVM8zTigl+VyJqH2zVq/dd8WbiDmvibIz MEwg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1697475467; x=1698080267; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:ui-outboundreport:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=TnLODCPET39yJ49gGAx+nEjWodMYeQYNLRBv3wsPgtc=; b=TIMitlYr2nMb4lLuB7+lm6Cr508PPaVIDJ/M+zgrWbmYpMhbH8CxUeq8u/YsCEZUoH N1GSro8XPcGeld+eTu+WyWIhRa7CBdMexYQ2MvMUwwCI8pNAX1F+s1tY86RryTZ0H6FB UUObpNlzB7s3aoOjEqKHSV2YMKB0ajsdmRVrZEzSb168OKMex7sYyznZEjOWuuNMIqWh 9OLx52xH+30W6akVTZWZ7OWfpr1q2xzAxj1oGba1qkaf7TQOb7kXD72+B2gZ+XB911OK 5yC5A6OXNCfMxjxAnFNgxp5qzvdnH8T+ql0s4GFuxCFFnHCMreXeQOkNXx5WMcRnBxPZ WKGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697475467; x=1698080267; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :ui-outboundreport:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=TnLODCPET39yJ49gGAx+nEjWodMYeQYNLRBv3wsPgtc=; b=J4pygUvnsjjM5X03Sn3Gh5o0uuZjfco1gxK2LygRi/9jHY+Rwe4X3sV3gfuAfyo15T YFtI8Sde+0dkussVU9yjaUUNCYTqOnnod5kB1yiSaoY/Z1Se/cU6LWCPyyu4QRdJf3wG wfrvcOl/skLv9Vxkao3XaXjpn2JBe97wdUmomiYpscuiD4Fv979sThdLdQdq1DBen3fw ELKPcmjyafPgjmPaZjnsZDZcCoBvfTaNv712d/SreRmmJ9l137njfxScMewkKWfkp6KX bgLxTdV3nrIaxge2ylYh8CcK2K7jK+c+aJDJrqJh5HSyLBbL3BKOxgvt6CSl/7bJnPxu r4Fg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOJu0Yy+dQZYNDn+KXNe87AlAyL5HePVhIED0FhjuFV3O+p5JolgIdsO YS7BzeE96LvyTYzd2Nq5QLA= X-Google-Smtp-Source: AGHT+IHJS/6ucmcjyk654iY+59v9gnx0951eO0qy4Xj6bXKgqehr4JdAwGPSMmSIZuMo4ikOv1rgQQ== X-Received: by 2002:a7b:c397:0:b0:406:52f1:7e6f with SMTP id s23-20020a7bc397000000b0040652f17e6fmr29596679wmj.12.1697475467163; Mon, 16 Oct 2023 09:57:47 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:4e8f:b0:3fb:f228:b8a with SMTP id f15-20020a05600c4e8f00b003fbf2280b8als635287wmq.1.-pod-prod-03-eu; Mon, 16 Oct 2023 09:57:45 -0700 (PDT) X-Received: by 2002:a1c:791a:0:b0:406:5308:cfeb with SMTP id l26-20020a1c791a000000b004065308cfebmr30620931wme.11.1697475465593; Mon, 16 Oct 2023 09:57:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697475465; cv=none; d=google.com; s=arc-20160816; b=uvaJwL/h6Qqj4MkigA75HG+jRL4iz6GKr9T+p3O6mFZ91wCRPCSZamWy3CegtEFqXq qY850ul5jeHNsHTQ/4d6E2i84I3420fThG09dC0+lSybuDdu/sIkVDi6wBGkqUPvUJNj C/5l3+CXfaH9MGFe1aAgBgt+vrdgzI3qizOEJ7FN8mhIQJenTvttGFVAoLe2Tjvvd2pJ djN7NO5EfJODGIffoCa1r4JEwMUmNdxAzgC97+qkXMsBWLRTiQK4TJG9JMbHgaZUsWaV bWCbi9JQFuCRWhfz2dDFVrYUm4Jr9rX4tS66sq95eMmyDJcHjTlP6uXPJrA0iRtlTgtk VOdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=D7zIGLFsL9BcCNv9/fG5bos4dMQ7J4Swrm7BV9BoLUU=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=TXU+ES1oWZAZQYvF26JjwzInjzKgdPMwXgJ7xVpifBeXVE6+wwtUrsmKvO/yqqvMJ4 0SpFfpBhrNAwVn9pfQ39ZAK8Vhfw2XdV/6mLpLI3RyCoiQDLCSChYEsx4v2EUILnVdxd FcE3Eyq71+BqwR7j6/X8VKeYRRtJHxVR89Lndkt4qmwhrzcqscmX3fwfYeFlGFnyUh91 qH37OAKdmwYwVNj7FTFZSlweGyxmbaec3fEypxs/YJjls9fnfBA8liasCQVXyNutoOgr fZjpheFwo3bnQuVhrfZArdHeg+eXp+5Pq6szNzbcWeqz1GAYgTaCX3DorA17DShywmFw QDAA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [212.227.17.10]) by gmr-mx.google.com with ESMTPS id m22-20020a05600c3b1600b0040476a42269si369882wms.2.2023.10.16.09.57.45 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 09:57:45 -0700 (PDT) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) client-ip=212.227.17.10; Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MsYzF-1rhMTC0dbv-00u5JV; Mon, 16 Oct 2023 18:57:45 +0200 From: Stefano Babic <stefano.babic@swupdate.org> To: swupdate@googlegroups.com Cc: Stefano Babic <stefano.babic@swupdate.org> Subject: [swupdate] [PATCH 11/12] Reset action_id after usage Date: Mon, 16 Oct 2023 18:57:39 +0200 Message-Id: <20231016165740.1374614-11-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016165740.1374614-1-stefano.babic@swupdate.org> References: <20231016165740.1374614-1-stefano.babic@swupdate.org> MIME-Version: 1.0 X-Provags-ID: V03:K1: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GYev8EQUOgvr9Dwv3gJ4o GIgf/ZgxgtRfE/kBwHQ7u70jNcA4LMJd3Na0MPp+HSDq/uMMYAamoWi/gL73d0i/tLQp19P2j PBrxYezNQjS1XqBkF8VdzY7qo27oxKIevLbM= X-Original-Sender: stefano.babic@swupdate.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.10 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[01/12] Cleanup: use #pragma once in all headers
|
expand
|
diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c index 9b71987c..572ee1e3 100644 --- a/suricatta/server_hawkbit.c +++ b/suricatta/server_hawkbit.c @@ -868,8 +868,14 @@ static void get_action_id_from_env(int *action_id) */ char *action_str = swupdate_vars_get("action_id", NULL); if (action_str) { - *action_id = ustrtoull(action_str, NULL, 10); - TRACE("Stored action_id from previous run: %d", *action_id); + int tmp = ustrtoull(action_str, NULL, 10); + /* + * action_id = 0 is invalid, then check it + */ + if (tmp > 0) { + *action_id = tmp; + TRACE("Retrieve action_id from previous run: %d", *action_id); + } free(action_str); } } @@ -937,6 +943,11 @@ server_op_res_t server_handle_initial_state(update_state_t stateovrrd) if (result != SERVER_UPDATE_AVAILABLE) return result; + /* + * Everything fine, reset action_id if any + */ + swupdate_vars_set("action_id", NULL, NULL); + /* NOTE (Re-)setting STATE_KEY=STATE_OK == '0' instead of deleting it * as it may be required for the switchback/recovery U-Boot logics. */
When a feedback is successfully sent, the action_id must be removed. This avoid that the feedback can be sent again with wrong action_id if SWUpdate is restarted (or if the boot resumes after a power cut). Signed-off-by: Stefano Babic <stefano.babic@swupdate.org> --- suricatta/server_hawkbit.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)