Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1009799ybz; Wed, 29 Apr 2020 13:21:42 -0700 (PDT) X-Google-Smtp-Source: APiQypK75zqXScEo2bJ8gi+6Rxeko7GPcYC4UJqRogpeSHNby1RBScpKVSLPYXW54l6/vd8AMcxl X-Received: by 2002:a05:6402:95e:: with SMTP id h30mr4122113edz.117.1588191702683; Wed, 29 Apr 2020 13:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588191702; cv=none; d=google.com; s=arc-20160816; b=R3bBvEOPq0NteSy4+FaNPvIcn18iMa1O9DBKpkbqXq0reutMKYtgktxhXj1c5hUKQ6 NNgbwWpI0upugke3GJ3WRwLznr8BeZAQoKA6bP6wnJQC7r8ukSJCZbrYf8qPK/z7s4de Yfg88xMNgQMpcKGC8aSMCusCtRciRcUXGVqMHuxC75hX8PE1Y9h/M59rdbn+NlyPhfwA jPfsRhFfOAJ3Z3RNs7tpcMpEOFwUsS7iNCEpdU0e4KhrphQzOUYEccSlD1p3XLcnjhuR mLeMG79VlfJ7zugVwLsNwu8DY6NfF8nDZoGe44+ZYKaiYbiFpqQiNEbzPaaboA0VqJwe lBmQ== 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:ironport-sdr:ironport-sdr; bh=Goc7wWgGbKgH2nLkK9boOF0N6dYPqCRkjwxkyeVWGNw=; b=NBAHpoSj4fS8by+NcUM1LlFH5IsUEaGXqUZ99b8F/9o7aRBC0/3lf82xk5BXfJ9Qx4 WldBBHatNSJ8X6i3a+Pr1cqBZwjFLUCMLkNlURzV1wieMX2pt4RPuGhoxGQw/xHMfnzW VLVw1OR2O8wGSBgnSMebrDZByqnhk9C6PeKicvEoZu9C88GTsLTn2y8lkyqYhJApXhep 7bzvLaI8xh398ok9bBwUK7Zwbb0ArcXr4KfFm+NAOKdUSmXW3nrrlCl5ApZJRZZCkcVh IV9QjIUuv1LcntN+Ykbcs8xS101f9Ko2jSKIsYzlrWHQ1p3obPivUXE3ixv5ppKawN4v 9ZtQ== 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 e16si4450251ejr.309.2020.04.29.13.21.01; Wed, 29 Apr 2020 13:21:42 -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 S1727090AbgD2UU4 (ORCPT + 99 others); Wed, 29 Apr 2020 16:20:56 -0400 Received: from mga06.intel.com ([134.134.136.31]:42197 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727089AbgD2UU4 (ORCPT ); Wed, 29 Apr 2020 16:20:56 -0400 IronPort-SDR: hKmpTgCmTbxvDgcQxcqmc2FuC7p2OI+xfXXdY0VFpRaYpzmi1e0U9bpsT5BoeOWy7yvpwPSTS5 E1+mw8F4lQhA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2020 13:20:55 -0700 IronPort-SDR: 7KYFMUyPvMfVBKyF3mukB7zDYXi/RgfZIuE9vo7Z7yqJ6wVtsXh39rnlyvwru9xt9vlkfk26f0 0PANEl8H5KuA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,333,1583222400"; d="scan'208";a="282617928" Received: from ingas-nuc1.sea.intel.com ([10.255.228.82]) by fmsmga004.fm.intel.com with ESMTP; 29 Apr 2020 13:20:55 -0700 From: Inga Stotland To: linux-bluetooth@vger.kernel.org Cc: brian.gix@intel.com, Inga Stotland Subject: [PATCH BlueZ] mesh: Fix publication setup for vendor models Date: Wed, 29 Apr 2020 13:20:54 -0700 Message-Id: <20200429202054.2397-1-inga.stotland@intel.com> X-Mailer: git-send-email 2.21.1 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 fixes model ID generation when processing Config Pub Set message. Also, cleanup some debug prints. --- mesh/cfgmod-server.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mesh/cfgmod-server.c b/mesh/cfgmod-server.c index 856eb6b27..1564175c7 100644 --- a/mesh/cfgmod-server.c +++ b/mesh/cfgmod-server.c @@ -124,7 +124,7 @@ static void config_pub_set(struct mesh_node *node, uint16_t net_idx, if (!vendor) mod_id |= VENDOR_ID_MASK; else - mod_id |= l_get_le16(pkt + 11 + virt_offset); + mod_id = (mod_id << 16) | l_get_le16(pkt + 11 + virt_offset); ele_addr = l_get_le16(pkt); pub_addr = pkt + 2; @@ -232,7 +232,7 @@ static bool config_sub_get(struct mesh_node *node, uint16_t net_idx, switch (size) { default: - l_debug("Bad Len Cfg_Pub_Set: %d", size); + l_debug("Bad length %d", size); return false; case 4: @@ -322,7 +322,7 @@ static void config_sub_set(struct mesh_node *node, uint16_t net_idx, switch (size) { default: - l_error("Bad Len Cfg_Sub_Set: %d", size); + l_error("Bad length: %d", size); return; case 4: if (opcode != OP_CONFIG_MODEL_SUB_DELETE_ALL) @@ -567,7 +567,6 @@ static void hb_pub_timeout_func(struct l_timeout *timeout, void *user_data) l_timeout_remove(hb->pub_timer); hb->pub_timer = NULL; } - l_debug("%d left", hb->pub_count); } static void update_hb_pub_timer(struct mesh_net *net, @@ -651,6 +650,7 @@ static int hb_subscription_set(struct mesh_net *net, uint16_t src, hb->sub_min_hops = 0; hb->sub_max_hops = 0; return MESH_STATUS_SUCCESS; + } else if (!period_log && src == hb->sub_src && dst == hb->sub_dst) { /* Preserve collected data, but disable */ l_timeout_remove(hb->sub_timer); -- 2.21.1