Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2221821ybg; Thu, 30 Jul 2020 13:43:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJXKTaD+xqhEf+IRjf2bcpI0oJalMMRB+WHe9ho8ryHIyQ//jzSBHx6yIUdbEZpOtzzCdE X-Received: by 2002:a17:906:998f:: with SMTP id af15mr814212ejc.461.1596141798103; Thu, 30 Jul 2020 13:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596141798; cv=none; d=google.com; s=arc-20160816; b=s2AVWlRLaTjGHVqa4hLXOFs3HTEgEm07mHa4SlLmQUwWcJZzGULzvHFcIKMANTl1nH +r6uGmRq2vbDNb8AWv+YFTsVwSRuLBrWyw1vOM8oqvrSCjswoK2HCOfaDlXwC9g3mNhm FYxj8ROW5HkQY8fzmqCM3TyvHJCmJvv380qaQJ9D0sOlSCyqFvptPKgYIW2es9MrSVFA LyKIT/+f3KT6u66gpRvWfF3ewbjSBsYyRhZXFSO7GQqn13BswzM1Wf9dQ9HlXYeCBtz3 1j5mmB0UvXS6k1VS+uU0dS7uY3ZYOBPvhZTez1eGi0GCmu/sCcHbAPGljLRKUZ4FHGy9 FJOA== 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=wgym3EjgYZuUezEkrVkMeKpI3/G3NoGoqxRrgbvsdnY=; b=hIt/+2LNcAQ3N3GNl4HqxWCOiwm6lEnsvHKaOnqkCuYQa8QykOb6Cor8OBBiT9kGlZ rdjMFvkuSaXHhTPzL3lRafq8CuOz+pDlVsTx1Erj+dXHkKV90VP2/rhUbmbtffw9PPpN 4LoVIJ66squR1UqP/Hf0jUlQv2DAAcPxrQ8/3vSYZtzOLHbj3ouPbWJ1Sfbm9prInEzO dCzTYYZJNc4HF7Vbo//CK0dshhayRdchyMylTbqUTMs4LnWHjP3Cc1XuwQ+PC9MtATgK jbyjOdspn362cD5/bc5MdNSWO4mvT07m9Ynm9ooDfGgdfrwmAW+qNnTwFXHA/r5lOvAI YyMg== 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 bx11si4360396edb.24.2020.07.30.13.42.54; Thu, 30 Jul 2020 13:43:18 -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 S1728774AbgG3UjA (ORCPT + 99 others); Thu, 30 Jul 2020 16:39:00 -0400 Received: from mga01.intel.com ([192.55.52.88]:35036 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728771AbgG3Ui7 (ORCPT ); Thu, 30 Jul 2020 16:38:59 -0400 IronPort-SDR: LorYiRARARr8OmO+o2ztxayJe2QHnj3t7DEjCnzonglHQKFoT5EPl+TBhVRxQMaQZ07O1OCXE/ h/B9mAxDUV1Q== X-IronPort-AV: E=McAfee;i="6000,8403,9698"; a="169803099" X-IronPort-AV: E=Sophos;i="5.75,415,1589266800"; d="scan'208";a="169803099" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2020 13:38:58 -0700 IronPort-SDR: 0nDAtzDAU6c8Bkc5TJmhhu+OulQY8kJo93NT6mXE+vyG2XmxCSZGmYExXaCfRsuzu3IM7V9wvA f5zV1La8KOeg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,415,1589266800"; d="scan'208";a="330864957" Received: from wlloyd-mobl.amr.corp.intel.com (HELO ingas-nuc1.intel.com) ([10.254.79.39]) by orsmga007.jf.intel.com with ESMTP; 30 Jul 2020 13:38:57 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, Inga Stotland Subject: [PATCH BlueZ 03/10] mesh: Clean up handling of config node identity message Date: Thu, 30 Jul 2020 13:38:44 -0700 Message-Id: <20200730203851.32043-4-inga.stotland@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200730203851.32043-1-inga.stotland@intel.com> References: <20200730203851.32043-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 6621d0935..1cd0bcdd5 100644 --- a/mesh/cfgmod-server.c +++ b/mesh/cfgmod-server.c @@ -774,11 +774,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 */ @@ -786,18 +782,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