Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1247500ybl; Thu, 12 Dec 2019 12:00:54 -0800 (PST) X-Google-Smtp-Source: APXvYqwgZZb0NSYnU2t0X6ZRJcp/oZJgOBHDzzJzRcdsv2SZYg9oIfsKaxSlGhiXZNqg9hBn1Y26 X-Received: by 2002:aca:ad47:: with SMTP id w68mr5972696oie.63.1576180854060; Thu, 12 Dec 2019 12:00:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576180854; cv=none; d=google.com; s=arc-20160816; b=w9AUog08isvzpsOt9DBlO0G1N8ijL2TzcEJ19TMYGq1xmOkGZ1kzSLyA0ZOJ1pRv38 GMh3M/DkLZHjLInQMKdlRHJObGJAM58SJvkc9WsqgIIb8PNHknJm5xan1nsb6dCM1OGQ 1r26u91dMuV8Hge3YWfyP3olWt9LTUoGPRIf96xx+paKKbIyO0pwt9hnsQTmIUjjTZeq /cWfHPgO4epBR9t0Hu6Gp9QT45phrJGzXa+v1Cg60MTnvfnMiB1HQNUCOIlwP0+ukUHU lv6fPGxHikiOIjVVWJhAsPA/DtxMoYjYwtNqzfiEElm/BvXtE6IC1basSIMqugGbvk+A mOtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Su+ttEoJH0RPuYFmKIjdLFpQftgLe7M2tfxn30l2PW0=; b=FbW/3jDAWPgmdefWDp6HbyFc8nTC1Ro3Qcb9DY82tjfIRBCFeN5ISqD7m32lFq2nbA 4oyYQ7YUMowsbEOCw8rWpvv1137/5l1hw85/CirRp+wohZdB4C4mqFN8C8OND8QctoAL 01IwMp6/K1GKcEbAG5vi7BLYlV+4CwjFqjXNuFxQwhDGkj24b/TFf0ROfSewNRdReabd AS1Y/tlHNWDCQ+1jUXqFVaFpc5+EqPykTWBpqi0mO7TyzBCiKBLMoHp0/wKBN0RLLo0U nd8vKK9U5Q2dp2aFpsvqOYMzkd3aTG4BwnQBppT/GIz8xTbWlIoBCyc5jY3cLiQbgCAF 7dIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e22si3846478oti.74.2019.12.12.12.00.33; Thu, 12 Dec 2019 12:00:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730703AbfLLUAb (ORCPT + 99 others); Thu, 12 Dec 2019 15:00:31 -0500 Received: from mga14.intel.com ([192.55.52.115]:21205 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730691AbfLLUAb (ORCPT ); Thu, 12 Dec 2019 15:00:31 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2019 12:00:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,306,1571727600"; d="scan'208";a="211225327" Received: from ingas-nuc1.sea.intel.com ([10.252.140.195]) by fmsmga008.fm.intel.com with ESMTP; 12 Dec 2019 12:00:25 -0800 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, Inga Stotland Subject: [PATCH BlueZ] mesh: Fix configuration update when deleting an AppKey Date: Thu, 12 Dec 2019 12:00:24 -0800 Message-Id: <20191212200024.2617-1-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org When an AppKey is deleted from a node, the configuration update is sent to the element model only if the model was bound to this AppKey. --- mesh/model.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mesh/model.c b/mesh/model.c index acdd94f7b..d998a9caa 100644 --- a/mesh/model.c +++ b/mesh/model.c @@ -650,7 +650,7 @@ static void model_unbind_idx(struct mesh_node *node, struct mesh_model *mod, /* Internal model */ mod->cbs->bind(idx, ACTION_DELETE); - if (mod->pub && idx != mod->pub->idx) + if (!mod->pub || idx != mod->pub->idx) return; /* Remove model publication if the publication key is unbound */ @@ -1319,7 +1319,8 @@ void mesh_model_app_key_delete(struct mesh_node *node, struct l_queue *models, for (; entry; entry = entry->next) { struct mesh_model *model = entry->data; - model_unbind_idx(node, model, app_idx); + if (has_binding(model->bindings, app_idx)) + model_unbind_idx(node, model, app_idx); } } -- 2.21.0