Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2459170ybg; Thu, 30 Jul 2020 23:20:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysljVEmwv2RvH4R+Kl9JHuXv7tJnYtuK51djeOjbs93IcE3U03S227tCPNZx6J3lh3u4Sv X-Received: by 2002:a50:d697:: with SMTP id r23mr2358594edi.223.1596176445442; Thu, 30 Jul 2020 23:20:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596176445; cv=none; d=google.com; s=arc-20160816; b=cJW/TNfBiom3NiEEOMphGSQHX1MtNEPxyo+MKp9kTdnZeLKL0lzh7YUjUQbQIHBldX 9IaMTPLAJt2yAqg9INqhzK74rX2SDc6Xf6FM1VXHmEw+YjvP4i1osvPdsW0dv1Ky1IiR kATN+xBDfz37PqFxyZtyKCbrliQAvxjnWX0uDZrqxLbHrYBimwYqSqhtjPOAP2PgD4+4 boDr4toeIvZdflyCF6V9nVNYkUmOJgPT7x3bqdUr6MGNieHyO0hT/qgAgRd3WszmKMUS 55WgdWageKJFbmEK/r3ax1q1UdufX8J7hBURdJMDxP2tHspQaPnVzRLHgLi9O6hvlbVs TZfw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=8fIYzu532ru4VsKi2NbQbvEy8558SVOfohArs6EMeu4=; b=tmBpN/hrYZz2+mPal+F6BdaSoWFuZR1uNC57VfSVvixpPVP9BeOOqNFKWUkoyw8vF4 pPaTosLgXa2XOVrQOfrTlHMrU0etzDZ4P6ZkW/JiCUTRbr2ki2+MuXfVx5S5hXl4M9Dg n7SyNw0A/Gki9pVAbdu2gV6IoctpI4tSh3VYCAnNw17XaU9Y2lKGbC5CLlqNtgdisGGq P37Pj5l7RL14UU+CrJkAqBe1ozd/EftGSjbQq/8Zwmk3GEPPe7FWUCFZxMWPK+IXzO/g rRM0zoc4pJQ6lXpmkExQZlpd85Z9+PL9JaCKpCSZ68crfd4MtU3RVYPCyS+roJD9YHjK QRig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id o7si4943196ejh.78.2020.07.30.23.20.03; Thu, 30 Jul 2020 23:20:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 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 S1731404AbgGaGTk (ORCPT + 99 others); Fri, 31 Jul 2020 02:19:40 -0400 Received: from mga06.intel.com ([134.134.136.31]:44828 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731413AbgGaGTk (ORCPT ); Fri, 31 Jul 2020 02:19:40 -0400 IronPort-SDR: NO6oIYmiWFNWzGy+63wdatIVKKfknqiWYc+SZWIlrTSS8YDEZsxWbDjJgKNQPdLwwy4EjpT0ze N8pcnXHJnfzA== X-IronPort-AV: E=McAfee;i="6000,8403,9698"; a="213269551" X-IronPort-AV: E=Sophos;i="5.75,417,1589266800"; d="scan'208";a="213269551" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2020 23:19:40 -0700 IronPort-SDR: O8Fx9XL4QNZkm8urtU8pyVowrxM2yeBU6/k3fxKtmMqE2DULf/BUfppjtAIcfpkdjrVVPnldSS /dn98EkVUSGA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,417,1589266800"; d="scan'208";a="329163341" Received: from wlloyd-mobl.amr.corp.intel.com (HELO ingas-nuc1.intel.com) ([10.254.79.39]) by FMSMGA003.fm.intel.com with ESMTP; 30 Jul 2020 23:19:39 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, Inga Stotland Subject: [PATCH BlueZ v2 03/10] mesh: Clean up handling of config node identity message Date: Thu, 30 Jul 2020 23:19:29 -0700 Message-Id: <20200731061936.56952-3-inga.stotland@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200731061936.56952-1-inga.stotland@intel.com> References: <20200731061936.56952-1-inga.stotland@intel.com> 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 This modification allows using a single point for sending out the composed status messages by the Config Server. --- mesh/cfgmod-server.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c index 8a92c6cd7..2d47429f7 100644 --- a/mesh/cfgmod-server.c +++ b/mesh/cfgmod-server.c @@ -773,11 +773,7 @@ static bool cfg_srv_pkt(uint16_t src, uint16_t dst, uint16_t app_idx, break; case OP_NODE_IDENTITY_SET: - if (size != 3 || pkt[2] > 0x01) - return true; - - n_idx = l_get_le16(pkt); - if (n_idx > 0xfff) + if (size != 3) return true; /* Currently setting node identity not supported */ @@ -785,18 +781,13 @@ static bool cfg_srv_pkt(uint16_t src, uint16_t dst, uint16_t app_idx, /* Fall Through */ case OP_NODE_IDENTITY_GET: - if (size < 2) + if (opcode == OP_NODE_IDENTITY_GET && size != 2) return true; n_idx = l_get_le16(pkt); - if (n_idx > 0xfff) - return true; n = mesh_model_opcode_set(OP_NODE_IDENTITY_STATUS, msg); - - status = mesh_net_get_identity_mode(net, n_idx, &state); - - msg[n++] = status; + msg[n++] = mesh_net_get_identity_mode(net, n_idx, &state); l_put_le16(n_idx, msg + n); n += 2; -- 2.26.2