Message ID | 20231017140657.95860-9-stefano.babic@swupdate.org |
---|---|
State | Accepted |
Delegated to: | Stefano Babic |
Headers | show
Return-Path: <swupdate+bncBAABBBVKXKUQMGQE4R2PGJI@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=hJl3Vieo; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::53e; helo=mail-ed1-x53e.google.com; envelope-from=swupdate+bncbaabbbvkxkuqmgqe4r2pgji@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-ed1-x53e.google.com (mail-ed1-x53e.google.com [IPv6:2a00:1450:4864:20::53e]) (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 4S8wlZ2T2hz23kK for <incoming@patchwork.ozlabs.org>; Wed, 18 Oct 2023 01:07:06 +1100 (AEDT) Received: by mail-ed1-x53e.google.com with SMTP id 4fb4d7f45d1cf-53e305a5a1bsf3544905a12.1 for <incoming@patchwork.ozlabs.org>; Tue, 17 Oct 2023 07:07:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697551623; cv=pass; d=google.com; s=arc-20160816; b=MNlV/22+xXFo2KoycFJK4iNKo+Q9YwcOxB32Wt8ZmWXlK6ESS+IjW7Qdc6jypjP/e9 +x3pVKmGagqP9FrRgiBQwUypGeJwOdO1+o8hLX2zIc6Plqdy0OHeRbC0uB7IC9qhj4io uBYxCvjzVBj45ALafNmZiWRtXpNJeNB8xObhUWu/yoPebwShafEyXksj3e7MqEZ9r/Fy okIXcIi0NvZhh8Xn7DiqKCMRiMJ3dAFslHtbrwe6vmEHdbV0BSdFJyFaHXSHLAcbHLys JpdlYHeyJT/2SBFtsK/ulf4S9iz+MKQtux2ghlsr8xCUMfyLHZMaDHrSZh/iT+b255Fc XYXQ== 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=ICH7qW2H2GJobXd44e6ZOxJ1BmnZ/uF4peyGM3yPw5Q=; fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=; b=QzL1zlln6dLYeI6xI2wiYuOui8YPuPKwQ9N+/653k9SASSsmugfsD/jyW72WRFx2RC RqjSdmI/Leo+YSVyE3srW3u9QuR9qgTMmocKycJw2uiHNoFssWFJyWPgxbFxBDAlcdN1 pB5jLLk0DbhcMT9enUsaTeXcHwAfeyf30X4iXxMxMXpbz3d66idl4V/O3XkFA+Cxd9P7 1UOEVj1rotA2ziC6YkToMwKbxE5ob19JSvDEJnV2QODNAU3kXQNh8uGIfVYk8NonGZHM Y65FLAtm8DUcbGQHxnG24cQkiEXJyFJxtEIY9rLvMgqmRJo9YgYCyhEFTB8kzxCncUut McIw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 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=1697551623; x=1698156423; 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=ICH7qW2H2GJobXd44e6ZOxJ1BmnZ/uF4peyGM3yPw5Q=; b=hJl3VieoshTwmMNXMAj8ky/mkElbHz/MIGce1fndI7WYDWWCYHhsFM37U3K7+Q2p2h WZcTAlSa39nKQhfFomZQWt/LBig7WtLmKekgCbJf6O+Uu26GwrOUhnicSaurzot5/cEk 7PUZ/aYmBELuAwJl+KCRfCPHO4V9hemHKfwv7chGbvHoZnqOgHi9IVOZLqAyzaiRGPsf nlWxiVV+cNQmBBT2vLp2CaU/JCJvIyvV7OGRNfm2pHSY3QIJL+6f+v22pz4ae2+Wi8YY 2X4mcn73BmhOU7+9hZsljVM/j/NsPfsPQEUXxd0KsPC67/Ws+xuVEeaYdmUcbDyIE4vs 2D1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697551623; x=1698156423; 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=ICH7qW2H2GJobXd44e6ZOxJ1BmnZ/uF4peyGM3yPw5Q=; b=tweqstOGuk5SlUJlhpoOXtcXGUopbbSo2mzaCpM8E5k4CmBdmpKP4mPcdpriMTfgAI U7AcTtfzRoi6Do8AeojNAyJpyqPIChr6M4KGxC6gNAooKRz0LRC4Dwgi0lkawe8av2O7 GB/Q34wO0Ufn6MUMD4uL058LQyc5TCiwJ78ABdodVjGsmcpP28UD29SiDLYLXeK0gW/k hNOuDSDdVgixCmDugtPUaiqjnrmMCUB+gZBhz7ZwDQ7XofuZuJPohCNorFJsdNHk0CGC ct9MDAP9TwEcFy7vrPKhDtTslDVlIpdALNG59tB/gHFR/02+cAITFyMuS75sCcUIls04 61nw== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOJu0Yy3cbtxgqLuQlH23k7EGuWC5n711cGpsA6Kbkg4u0qCJlLnrHbW 4EDGdurGNXGbojyPEN0sasU= X-Google-Smtp-Source: AGHT+IGC4ECzUiwW2+uj1dkIQU4zp6sM1iYijeVsYHdnJVwDU6jgIl9W5uO5kN8c3FWPCAWFLNC4jw== X-Received: by 2002:a05:6402:40ce:b0:53d:d8ad:4d46 with SMTP id z14-20020a05640240ce00b0053dd8ad4d46mr2390692edb.36.1697551623138; Tue, 17 Oct 2023 07:07:03 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6402:5d1:b0:52f:3b2b:a285 with SMTP id n17-20020a05640205d100b0052f3b2ba285ls152019edx.0.-pod-prod-03-eu; Tue, 17 Oct 2023 07:07:01 -0700 (PDT) X-Received: by 2002:a05:6402:510d:b0:53e:467c:33f8 with SMTP id m13-20020a056402510d00b0053e467c33f8mr2338686edd.20.1697551621721; Tue, 17 Oct 2023 07:07:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697551621; cv=none; d=google.com; s=arc-20160816; b=oItifjyAKAwGw0wFvTnLWvhGJcrwv7CB7Qd9w8PB9mLEu7i+czmlvrEg9Lhu87DvQN ojRIqA+tLfsxhxINGiBIquU6+lJOSObOHlsXdOfdgU2HNTfLiBYXtwJ9aYJ8ryfkArlu t6mHuHvR5mmEwiWjCWSG1l7ueEjhWsSId41sOdz2gdkPHvx8AfRs2ho2BJrPophmCa9e qMHGZhRL8omciSQpXTalspFG+GpATBeM2qMMgNtHl2KNYWlLpXejqtmqPSN+FMLIltkf 3sFfK3sPPyuqe7Z1W0VN/5QfV857uzhgM6Z6oZX5EecJoUUDhgLjF4q/TVVFR4qnKbvU gGLw== 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=RwqQIHb04+GNcGgW6mZ8fcvlMKLSEpOOYCGNr3CqSlszOyyX5tEDLHWXJoHvIBhcno 7TlbFSPUo+UnI0WrXWb2tnCoTriTm5us2ZOuvnhkqRefUasHivYQ+NfxKvmVHC0kizqy f+x7nTTlP6IYhlEwa7j7IxolXQxKJtNyuNwHyCkKfjHv5IzZsNC+xuOXRE/sZy5b859v 4EdPEjwl1jqSuRpOqjar9zPlG0NkfrRtpno9W1jTP7XQPSwlaENuqdxnUYhtIW8kduE/ C3ERVoGoXo1NAD1siq5ap7FFRUY9HFay7n5n1UsUjUF9O1ug66+ZPx90cxZZM5lj1pMZ qyvg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org Received: from mout.kundenserver.de (mout.kundenserver.de. [217.72.192.73]) by gmr-mx.google.com with ESMTPS id l17-20020aa7d951000000b0053e90546ff6si72387eds.1.2023.10.17.07.07.01 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 07:07:01 -0700 (PDT) Received-SPF: pass (google.com: domain of stefano.babic@swupdate.org designates 217.72.192.73 as permitted sender) client-ip=217.72.192.73; Received: from paperino.fritz.box ([88.217.136.221]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1MIMT4-1qnGYS3xMC-00EK7n; Tue, 17 Oct 2023 16:07:01 +0200 From: Stefano Babic <stefano.babic@swupdate.org> To: swupdate@googlegroups.com Cc: Stefano Babic <stefano.babic@swupdate.org> Subject: [swupdate] [PATCH V2 08/11] Reset action_id after usage Date: Tue, 17 Oct 2023 16:06:54 +0200 Message-Id: <20231017140657.95860-9-stefano.babic@swupdate.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231017140657.95860-1-stefano.babic@swupdate.org> References: <20231017140657.95860-1-stefano.babic@swupdate.org> MIME-Version: 1.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pCrO8veQgJMrR0me2PY2/B+qwLREYFvf BFVwUFhXIRsRvgN4Sp7klo4MjIl+n9yPjLvLwJgt+1HcQpo6pi3fWKMu7AZY2WVFKpFhSY8wu v1spteW+VMJfjWA== 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 217.72.192.73 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 |
Handle Hawkbit action_id and on the fly updates
|
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(-)