Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp937862rwb; Mon, 26 Sep 2022 07:43:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4/Qbub2v21GwkN75dfi/i94wlrifPC9PzmmEityBeKcB6oSooBZhIYaFwhTo/lyjXvBhzI X-Received: by 2002:a63:6d44:0:b0:439:a999:e8ac with SMTP id i65-20020a636d44000000b00439a999e8acmr19525470pgc.548.1664203386930; Mon, 26 Sep 2022 07:43:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664203386; cv=none; d=google.com; s=arc-20160816; b=bK/Lhx7h+dOxyqnJMhsZi0gMZeYoJlJwCsPiQorb6o0nR5pJV57+hzKXXt7+JPwAlR M1p9c3we3+NHR9VHaxpPl7kp7kQtO5VkjLZdhEdho0SBaiPNtYUGbR1jmfEaqvcw7pV3 wN/eO6TkC4B0etYLWfNJDyC6pRJdlvdj7i5yoiILYgiwiK25iQls0kqcNLfMa9WKeNRu tghsUShZ+5tZP0w036NDCGkirCLRTz0VmOqcQGAenHWs+nOdtjS/tqUaKMx6dTtbNq1X qm8QJG+MCCy1MgVW8Xg1xJ6IvTOFPo9NTMEvaMz9zXXtGOv5GJKv/p7p55pCgSLp5P3w PTIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=gfZWYsIiWMJdc6JJ/LjwLFCuORKnwKfAYuAWN4qRaeo=; b=FB0CgGtG7hHwvNjp6HLeztupyxs9nxJ5IeiFx0o+g77pG5Q1Ngnduzf1y8B+DHP/wb S4V02Bo/VxOomvA0Nm/+JOoKcvECF533bjkJO+uRXfcXvoh8oGeoPKyxKShe3cmPVTcr QJWuXac2ZvitgINiQ+QaPVtDIzDdGbE6j0h6m8HFcSyabRDSPTrweuKhfWdRQOwGS/sA VLIcxwgXvXQ0tLccxqCsTPvBGx1S6ng1JQcmr15xKuDP67uQptAF8fwryFL6VMyecwl4 LLJclVsMack6OytoO3IjzewLOraClJtUS4TUdDayYW0BfV22UmscAHRJGfKTET5Bh3IJ wyjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f22-20020a63de16000000b0043954e0e18bsi17007931pgg.235.2022.09.26.07.41.54; Mon, 26 Sep 2022 07:43:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-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; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235044AbiIZOlV (ORCPT + 99 others); Mon, 26 Sep 2022 10:41:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235052AbiIZOk4 (ORCPT ); Mon, 26 Sep 2022 10:40:56 -0400 Received: from voyager.loytec.com (voyager.loytec.com [88.198.4.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EFFD106F6A for ; Mon, 26 Sep 2022 06:01:46 -0700 (PDT) Received: from 212-17-98-152.static.upcbusiness.at ([212.17.98.152] helo=lexx.office.loytec.com) by voyager.loytec.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ocnk0-00046q-IG for linux-bluetooth@vger.kernel.org; Mon, 26 Sep 2022 15:01:44 +0200 Received: from loytec-dev-vm.delta.corp ([10.101.25.21]) by lexx.office.loytec.com (8.15.2/8.15.2/Some OS 1.2.3-4.5) with ESMTP id 28QD1bCW1107873; Mon, 26 Sep 2022 15:01:42 +0200 From: Isak Westin To: linux-bluetooth@vger.kernel.org Cc: Isak Westin Subject: [PATCH BlueZ 2/4] mesh: Reply to HB pub set with same fields Date: Mon, 26 Sep 2022 15:01:08 +0200 Message-Id: <20220926130110.2146-3-isak.westin@loytec.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220926130110.2146-1-isak.westin@loytec.com> References: <20220926130110.2146-1-isak.westin@loytec.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 212.17.98.152 X-SA-Exim-Mail-From: isak.westin@loytec.com X-SA-Exim-Scanned: No (on voyager.loytec.com); SAEximRunCond expanded to false X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham 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-bluetooth@vger.kernel.org If a Config Heartbeat Publication Set message is unsuccessfully processed, the fields in the status reply should be the same as in the original message. See MshPRFv1.0.1 section 4.4.1.2.15. --- mesh/cfgmod-server.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c index 33796d05a..9c5edf551 100644 --- a/mesh/cfgmod-server.c +++ b/mesh/cfgmod-server.c @@ -575,7 +575,17 @@ static uint16_t hb_publication_set(struct mesh_node *node, const uint8_t *pkt) status = mesh_net_set_heartbeat_pub(net, dst, features, net_idx, ttl, count_log, period_log); - return hb_publication_get(node, status); + if (status != MESH_STATUS_SUCCESS) { + uint16_t n; + + n = mesh_model_opcode_set(OP_CONFIG_HEARTBEAT_PUB_STATUS, msg); + msg[n++] = status; + memcpy(msg + n, pkt, 9); + n += 9; + + return n; + } else + return hb_publication_get(node, status); } static void node_reset(void *user_data) -- 2.20.1