Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp712503pxa; Wed, 5 Aug 2020 10:56:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfA/WJhEE2ucnOKPgEbgnFErK0XlFXJyeooFViEGX/zUeF0yxqrPCxcAo1zjFXVwk6HPWa X-Received: by 2002:a17:906:8318:: with SMTP id j24mr374550ejx.409.1596650175505; Wed, 05 Aug 2020 10:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596650175; cv=none; d=google.com; s=arc-20160816; b=RLn2+IMsdXXcVH2lVqfanWD5QLpA58dRZKvW1rSZYcU4NqJM82ICRXzEyLv2nMShOX 0G97aFmAi/jgmWtC5kGKC9CaEI2yE5Hmu7DKbdK+0jmTEznZy4GmZN7PLgk1SejaPiBz e1hGs+vJhh5oIJQcxubuG39OZgWA09DCALGC1QFKXbVU3xE4X4tLJiQNgQw7nZMuW1i2 HVwitS5Kxb3bFUw1EPciL5VbvG3GgvhQki8dsEyjgUvzVSQrCh26CHa9tOaK9BCEhS8z rAAD0fIcX8p2LAqnQtbQAiPsbdx5quamkmr6YjTSFHcWOed2cvcYXYEiszp3o6LqsIii vRIg== 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=qwQZMjSG3qPMW1YvdyMigVRtlOTKEUxlH6tzXt4wIzg=; b=uJtl5fcqGGEWcPwkHyPnob+RnD/7ww8DHA1kVJoM3G+aowGEmwcuYWr/ooKeWrTuXi NTITdMHDVECixSUxx8UpXIW8Qf/T/D6N0u8Lz8u9mNw036HyomImIdOWU9OX1ZtDcwJP 2xRAHU6j57L74xIyAQFWKdWAZpDmEOlJpfSDgJbCFOxYbNN5J2ZvPDmUth15hORuIj1H mTRLuLftYw0WDd0WMZP65g1yK8H4FkLBY2P7c0OwR6gYn24Cc18qwWAiPk1uQlYAVAkE zxTPqTY46/fxDfmPhNiQuo4Ni1NFl5v3jdl2WJ8A92aDeib7IreYvFO/SuyTdogiSxXa h50A== 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 g16si1553753edr.534.2020.08.05.10.55.51; Wed, 05 Aug 2020 10:56:15 -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 S1728859AbgHERwO (ORCPT + 99 others); Wed, 5 Aug 2020 13:52:14 -0400 Received: from mga05.intel.com ([192.55.52.43]:42221 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728997AbgHERuy (ORCPT ); Wed, 5 Aug 2020 13:50:54 -0400 IronPort-SDR: eaZqSI89yVxW4+eQH4DzyI96qMTXiwOCS2kHuTod+K6rMeoeAs4DP12gaaUeJe4I7Mi9x7NZAO lJg+611kmwsw== X-IronPort-AV: E=McAfee;i="6000,8403,9704"; a="237470632" X-IronPort-AV: E=Sophos;i="5.75,438,1589266800"; d="scan'208";a="237470632" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2020 10:44:58 -0700 IronPort-SDR: iofcmEzlugcWij2qhLQZ2xXtS3SKLEicyEkRbLotLLe/9abwuftYJ81YBRMy1rFCu7TMl2ANkE ZTqaH0Q0J7TA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,438,1589266800"; d="scan'208";a="437245728" Received: from unknown (HELO ingas-nuc1.intel.com) ([10.254.118.189]) by orsmga004.jf.intel.com with ESMTP; 05 Aug 2020 10:44:58 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, Inga Stotland Subject: [PATCH BlueZ v4 03/10] mesh: Clean up handling of config node identity message Date: Wed, 5 Aug 2020 10:44:49 -0700 Message-Id: <20200805174456.49342-4-inga.stotland@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200805174456.49342-1-inga.stotland@intel.com> References: <20200805174456.49342-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 35d0325a9..c501b0a52 100644 --- a/mesh/cfgmod-server.c +++ b/mesh/cfgmod-server.c @@ -777,11 +777,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 */ @@ -789,18 +785,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