Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp861254rwb; Fri, 23 Sep 2022 05:16:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4d24w9nMhKlSlr2ZhvPiu5bdAqLyBL+nVkb1Sen4M5L6RLe7c8fovmgTKICKknMNNL6+4Q X-Received: by 2002:a05:6402:3213:b0:453:4426:a97b with SMTP id g19-20020a056402321300b004534426a97bmr7989924eda.8.1663935386286; Fri, 23 Sep 2022 05:16:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663935386; cv=none; d=google.com; s=arc-20160816; b=DGT/5KzZPUuKE61RLD0h7e9DedpvmgiB/PCUWRMNBJkOy51j4r+yY+bEtvfkhs4hSn XVdD/OxwJ7g81UNh5aN/U1cwYVpvsoKlg97b2wI29dl4UYGh34tSfPLShNf9MPvSgbl4 GcaOlm5Nha+hx25JbjDPXrqGGDLn2lFskFcqKQF4Nu34Nw9PC9qCpXGOhOw3iWrYY8RS iEmZIjJm7dBq4Yo1EjrDABc2razYVEoZlLgbPYT0mvWkRPfoMT9s08JX+RJoFK+PFk8n wevQrHKqqEQy+teACd5m7hH75cDSi7/HGzIiAlRgIEWXqlD84658E1RvyCMjhQB0/3YQ awkg== 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=FtH3lgRt2w4Qoj8TloMcFceo5Dpq1cKoM0SzNhTfIE4=; b=zMMddQGZjxgZnOGDMMdU+72Hz1cGm3fnn0Kty781T7B19+VC0z5qbLsoST89sRxjZ6 irzknwGKhUimzBcLOE8k6dNJ5gGMClY85F3mnitcz6EMoHXHrjDBmhX+6aPKJXL/qjVM jBveAUehspjM+fG6jHpNQJ0N8mi6IeLxf7iFOCLu4YoDjLFeOWthaqQgwuCMR2mkD6V1 2IxXak1OBUWNTtp2y/xm+t+G4QpVSZBwBe3F818hxK94mBh97WNi02BVJRFTzLWej8F7 B0VKvoIlWajQbxJ8gVcTwdCKUerlysthH5SkW/4LMVq8bBeDF0Dixqujqq3XCoEyPEe2 qaXg== 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 k12-20020a50cb8c000000b00454424b5c2csi7011060edi.314.2022.09.23.05.15.27; Fri, 23 Sep 2022 05:16:26 -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 S232059AbiIWMGU (ORCPT + 99 others); Fri, 23 Sep 2022 08:06:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231522AbiIWMER (ORCPT ); Fri, 23 Sep 2022 08:04:17 -0400 X-Greylist: delayed 1625 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 23 Sep 2022 04:59:25 PDT Received: from voyager.loytec.com (voyager.loytec.com [88.198.4.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29744138F36 for ; Fri, 23 Sep 2022 04:59:25 -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 1obgux-0000M2-Q7 for linux-bluetooth@vger.kernel.org; Fri, 23 Sep 2022 13:32:27 +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 28NBWF7h3687927; Fri, 23 Sep 2022 13:32:25 +0200 From: Isak Westin To: linux-bluetooth@vger.kernel.org Cc: Isak Westin Subject: [PATCH BlueZ 1/2] mesh: Clear addr field if virt sub failed Date: Fri, 23 Sep 2022 13:31:48 +0200 Message-Id: <20220923113149.14209-2-isak.westin@loytec.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220923113149.14209-1-isak.westin@loytec.com> References: <20220923113149.14209-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 processing failed for a Config Model Subscription Virtual Address Add/Delete/Overwrite message, the address field in the status reply should be set to zero. See MshPRFv1.0.1 section 4.4.1.2.8. --- mesh/cfgmod-server.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c index c1e1faa6a..9bc2f1c97 100644 --- a/mesh/cfgmod-server.c +++ b/mesh/cfgmod-server.c @@ -286,6 +286,10 @@ static uint16_t cfg_virt_sub_add_msg(struct mesh_node *node, const uint8_t *pkt, label, true, addr, opcode)) msg[n] = MESH_STATUS_STORAGE_FAIL; + /* If processing failed, set addr field to zero in reply */ + if (msg[n] != MESH_STATUS_SUCCESS) + addr = UNASSIGNED_ADDRESS; + l_put_le16(ele_addr, msg + n + 1); l_put_le16(addr, msg + n + 3); -- 2.20.1