* [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix
@ 2025-06-27 7:57 Christian Eggers
0 siblings, 0 replies; 12+ messages in thread
From: Christian Eggers @ 2025-06-27 7:57 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Christian Eggers
---
doc/mesh-api.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/mesh-api.txt b/doc/mesh-api.txt
index ea6f034db8a5..c67b8411d797 100644
--- a/doc/mesh-api.txt
+++ b/doc/mesh-api.txt
@@ -1018,7 +1018,7 @@ Properties:
Element index. It is required that the application follows
sequential numbering scheme for the elements, starting with 0.
- array{(uint16 id, dict caps)} Models [read-only]
+ array{(uint16 id, dict options)} Models [read-only]
An array of SIG Models:
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix
@ 2025-06-27 7:59 Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 2/9] mesh: keyring: constify Christian Eggers
` (9 more replies)
0 siblings, 10 replies; 12+ messages in thread
From: Christian Eggers @ 2025-06-27 7:59 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Christian Eggers
---
doc/mesh-api.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/mesh-api.txt b/doc/mesh-api.txt
index ea6f034db8a5..c67b8411d797 100644
--- a/doc/mesh-api.txt
+++ b/doc/mesh-api.txt
@@ -1018,7 +1018,7 @@ Properties:
Element index. It is required that the application follows
sequential numbering scheme for the elements, starting with 0.
- array{(uint16 id, dict caps)} Models [read-only]
+ array{(uint16 id, dict options)} Models [read-only]
An array of SIG Models:
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH BlueZ 2/9] mesh: keyring: constify
2025-06-27 7:59 [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix Christian Eggers
@ 2025-06-27 7:59 ` Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 3/9] mesh: mesh-config: constify Christian Eggers
` (8 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Christian Eggers @ 2025-06-27 7:59 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Christian Eggers
---
mesh/keyring.c | 4 ++--
mesh/keyring.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/mesh/keyring.c b/mesh/keyring.c
index cb091e15b613..3a09876777fd 100644
--- a/mesh/keyring.c
+++ b/mesh/keyring.c
@@ -67,7 +67,7 @@ static int open_key_file(struct mesh_node *node, const char *key_dir,
}
bool keyring_put_net_key(struct mesh_node *node, uint16_t net_idx,
- struct keyring_net_key *key)
+ const struct keyring_net_key *key)
{
bool result = false;
int fd;
@@ -191,7 +191,7 @@ bool keyring_finalize_app_keys(struct mesh_node *node, uint16_t net_idx)
}
bool keyring_put_remote_dev_key(struct mesh_node *node, uint16_t unicast,
- uint8_t count, uint8_t dev_key[16])
+ uint8_t count, const uint8_t dev_key[16])
{
const char *node_path;
char key_file[PATH_MAX];
diff --git a/mesh/keyring.h b/mesh/keyring.h
index efc499ac267e..e2088edfde14 100644
--- a/mesh/keyring.h
+++ b/mesh/keyring.h
@@ -23,7 +23,7 @@ struct keyring_app_key {
};
bool keyring_put_net_key(struct mesh_node *node, uint16_t net_idx,
- struct keyring_net_key *key);
+ const struct keyring_net_key *key);
bool keyring_get_net_key(struct mesh_node *node, uint16_t net_idx,
struct keyring_net_key *key);
bool keyring_del_net_key(struct mesh_node *node, uint16_t net_idx);
@@ -36,7 +36,7 @@ bool keyring_del_app_key(struct mesh_node *node, uint16_t app_idx);
bool keyring_get_remote_dev_key(struct mesh_node *node, uint16_t unicast,
uint8_t dev_key[16]);
bool keyring_put_remote_dev_key(struct mesh_node *node, uint16_t unicast,
- uint8_t count, uint8_t dev_key[16]);
+ uint8_t count, const uint8_t dev_key[16]);
bool keyring_del_remote_dev_key(struct mesh_node *node, uint16_t unicast,
uint8_t count);
bool keyring_del_remote_dev_key_all(struct mesh_node *node, uint16_t unicast);
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH BlueZ 3/9] mesh: mesh-config: constify
2025-06-27 7:59 [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 2/9] mesh: keyring: constify Christian Eggers
@ 2025-06-27 7:59 ` Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 4/9] mesh: util: constify Christian Eggers
` (7 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Christian Eggers @ 2025-06-27 7:59 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Christian Eggers
removing 2 prototypes where an implementation never existed
---
mesh/mesh-config-json.c | 14 +++++++-------
mesh/mesh-config.h | 20 ++++++++------------
2 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/mesh/mesh-config-json.c b/mesh/mesh-config-json.c
index 86e7d87e482e..5ad4d832a05a 100644
--- a/mesh/mesh-config-json.c
+++ b/mesh/mesh-config-json.c
@@ -739,7 +739,7 @@ bool mesh_config_net_key_del(struct mesh_config *cfg, uint16_t idx)
return save_config(jnode, cfg->node_dir_path);
}
-bool mesh_config_write_device_key(struct mesh_config *cfg, uint8_t *key)
+bool mesh_config_write_device_key(struct mesh_config *cfg, const uint8_t *key)
{
if (!cfg || !add_key_value(cfg->jnode, deviceKey, key))
return false;
@@ -747,7 +747,7 @@ bool mesh_config_write_device_key(struct mesh_config *cfg, uint8_t *key)
return save_config(cfg->jnode, cfg->node_dir_path);
}
-bool mesh_config_write_candidate(struct mesh_config *cfg, uint8_t *key)
+bool mesh_config_write_candidate(struct mesh_config *cfg, const uint8_t *key)
{
if (!cfg || !add_key_value(cfg->jnode, deviceCan, key))
return false;
@@ -782,7 +782,7 @@ bool mesh_config_finalize_candidate(struct mesh_config *cfg)
return save_config(cfg->jnode, cfg->node_dir_path);
}
-bool mesh_config_write_token(struct mesh_config *cfg, uint8_t *token)
+bool mesh_config_write_token(struct mesh_config *cfg, const uint8_t *token)
{
if (!cfg || !add_u64_value(cfg->jnode, "token", token))
return false;
@@ -2005,7 +2005,7 @@ bool mesh_config_net_key_set_phase(struct mesh_config *cfg, uint16_t idx,
bool mesh_config_model_pub_add(struct mesh_config *cfg, uint16_t ele_addr,
uint32_t mod_id, bool vendor,
- struct mesh_config_pub *pub)
+ const struct mesh_config_pub *pub)
{
json_object *jnode, *jmodel, *jpub, *jrtx;
bool res;
@@ -2146,7 +2146,7 @@ void mesh_config_comp_page_del(struct mesh_config *cfg, uint8_t page)
}
bool mesh_config_comp_page_add(struct mesh_config *cfg, uint8_t page,
- uint8_t *data, uint16_t size)
+ const uint8_t *data, uint16_t size)
{
json_object *jnode, *jstring, *jarray = NULL;
char *buf;
@@ -2187,7 +2187,7 @@ bool mesh_config_comp_page_add(struct mesh_config *cfg, uint8_t page,
bool mesh_config_model_sub_add(struct mesh_config *cfg, uint16_t ele_addr,
uint32_t mod_id, bool vendor,
- struct mesh_config_sub *sub)
+ const struct mesh_config_sub *sub)
{
json_object *jnode, *jmodel, *jstring, *jarray = NULL;
int ele_idx, len;
@@ -2239,7 +2239,7 @@ bool mesh_config_model_sub_add(struct mesh_config *cfg, uint16_t ele_addr,
bool mesh_config_model_sub_del(struct mesh_config *cfg, uint16_t ele_addr,
uint32_t mod_id, bool vendor,
- struct mesh_config_sub *sub)
+ const struct mesh_config_sub *sub)
{
json_object *jnode, *jmodel, *jarray;
char buf[33];
diff --git a/mesh/mesh-config.h b/mesh/mesh-config.h
index 3cb20b85d5c3..b320116fa8dc 100644
--- a/mesh/mesh-config.h
+++ b/mesh/mesh-config.h
@@ -128,15 +128,11 @@ struct mesh_config *mesh_config_create(const char *cfgdir_name,
bool mesh_config_write_net_transmit(struct mesh_config *cfg, uint8_t cnt,
uint16_t interval);
-bool mesh_config_write_device_key(struct mesh_config *cfg, uint8_t *key);
-bool mesh_config_write_candidate(struct mesh_config *cfg, uint8_t *key);
+bool mesh_config_write_device_key(struct mesh_config *cfg, const uint8_t *key);
+bool mesh_config_write_candidate(struct mesh_config *cfg, const uint8_t *key);
bool mesh_config_read_candidate(struct mesh_config *cfg, uint8_t *key);
bool mesh_config_finalize_candidate(struct mesh_config *cfg);
-bool mesh_config_write_token(struct mesh_config *cfg, uint8_t *token);
-bool mesh_config_write_network_key(struct mesh_config *cfg, uint16_t idx,
- uint8_t *key, uint8_t *new_key, int phase);
-bool mesh_config_write_app_key(struct mesh_config *cfg, uint16_t net_idx,
- uint16_t app_idx, uint8_t *key, uint8_t *new_key);
+bool mesh_config_write_token(struct mesh_config *cfg, const uint8_t *token);
bool mesh_config_write_seq_number(struct mesh_config *cfg, uint32_t seq,
bool cache);
bool mesh_config_write_unicast(struct mesh_config *cfg, uint16_t unicast);
@@ -150,7 +146,7 @@ bool mesh_config_write_mode(struct mesh_config *cfg, const char *keyword,
bool mesh_config_write_mode_ex(struct mesh_config *cfg, const char *keyword,
int value, bool save);
bool mesh_config_comp_page_add(struct mesh_config *cfg, uint8_t page,
- uint8_t *data, uint16_t size);
+ const uint8_t *data, uint16_t size);
void mesh_config_comp_page_del(struct mesh_config *cfg, uint8_t page);
bool mesh_config_model_binding_add(struct mesh_config *cfg, uint16_t ele_addr,
uint32_t mod_id, bool vendor,
@@ -159,16 +155,16 @@ bool mesh_config_model_binding_del(struct mesh_config *cfg, uint16_t ele_addr,
uint32_t mod_id, bool vendor,
uint16_t app_idx);
bool mesh_config_model_pub_add(struct mesh_config *cfg, uint16_t ele_addr,
- uint32_t mod_id, bool vendor,
- struct mesh_config_pub *pub);
+ uint32_t mod_id, bool vendor,
+ const struct mesh_config_pub *pub);
bool mesh_config_model_pub_del(struct mesh_config *cfg, uint16_t ele_addr,
uint32_t mod_id, bool vendor);
bool mesh_config_model_sub_add(struct mesh_config *cfg, uint16_t ele_addr,
uint32_t mod_id, bool vendor,
- struct mesh_config_sub *sub);
+ const struct mesh_config_sub *sub);
bool mesh_config_model_sub_del(struct mesh_config *cfg, uint16_t ele_addr,
uint32_t mod_id, bool vendor,
- struct mesh_config_sub *sub);
+ const struct mesh_config_sub *sub);
bool mesh_config_model_sub_del_all(struct mesh_config *cfg, uint16_t ele_addr,
uint32_t mod_id, bool vendor);
bool mesh_config_model_pub_enable(struct mesh_config *cfg, uint16_t ele_addr,
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH BlueZ 4/9] mesh: util: constify
2025-06-27 7:59 [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 2/9] mesh: keyring: constify Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 3/9] mesh: mesh-config: constify Christian Eggers
@ 2025-06-27 7:59 ` Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 5/9] mesh: mesh_net_transport_send: simplify Christian Eggers
` (6 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Christian Eggers @ 2025-06-27 7:59 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Christian Eggers
---
mesh/util.c | 2 +-
mesh/util.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mesh/util.c b/mesh/util.c
index 73f13aab7d64..348401ae5582 100644
--- a/mesh/util.c
+++ b/mesh/util.c
@@ -75,7 +75,7 @@ bool str2hex(const char *str, uint16_t in_len, uint8_t *out,
return true;
}
-size_t hex2str(uint8_t *in, size_t in_len, char *out, size_t out_len)
+size_t hex2str(const uint8_t *in, size_t in_len, char *out, size_t out_len)
{
static const char hexdigits[] = "0123456789abcdef";
size_t i;
diff --git a/mesh/util.h b/mesh/util.h
index bb417dc40f16..36247ea4d6c3 100644
--- a/mesh/util.h
+++ b/mesh/util.h
@@ -11,7 +11,7 @@
uint32_t get_timestamp_secs(void);
bool str2hex(const char *str, uint16_t in_len, uint8_t *out,
uint16_t out_len);
-size_t hex2str(uint8_t *in, size_t in_len, char *out, size_t out_len);
+size_t hex2str(const uint8_t *in, size_t in_len, char *out, size_t out_len);
void print_packet(const char *label, const void *data, uint16_t size);
int create_dir(const char *dir_name);
void del_path(const char *path);
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH BlueZ 5/9] mesh: mesh_net_transport_send: simplify
2025-06-27 7:59 [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix Christian Eggers
` (2 preceding siblings ...)
2025-06-27 7:59 ` [PATCH BlueZ 4/9] mesh: util: constify Christian Eggers
@ 2025-06-27 7:59 ` Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 6/9] mesh: node_add_pending_local: use concrete type Christian Eggers
` (5 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Christian Eggers @ 2025-06-27 7:59 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Christian Eggers
No need for internal copy of 'seq'.
---
mesh/net.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/mesh/net.c b/mesh/net.c
index cc862dade5ae..f26a63f178c2 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -3411,7 +3411,6 @@ void mesh_net_transport_send(struct mesh_net *net, uint32_t net_key_id,
uint16_t dst, const uint8_t *msg,
uint16_t msg_len)
{
- uint32_t use_seq = seq;
uint8_t pkt_len;
uint8_t pkt[30];
bool result = false;
@@ -3463,13 +3462,13 @@ void mesh_net_transport_send(struct mesh_net *net, uint32_t net_key_id,
return;
net_key_id = subnet->net_key_tx;
- use_seq = mesh_net_next_seq_num(net);
+ seq = mesh_net_next_seq_num(net);
if (result || (dst >= net->src_addr && dst <= net->last_addr))
return;
}
- if (!mesh_crypto_packet_build(true, ttl, use_seq, src, dst, msg[0],
+ if (!mesh_crypto_packet_build(true, ttl, seq, src, dst, msg[0],
false, 0, false, false, 0, 0, 0, msg + 1,
msg_len - 1, pkt + 1, &pkt_len))
return;
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH BlueZ 6/9] mesh: node_add_pending_local: use concrete type
2025-06-27 7:59 [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix Christian Eggers
` (3 preceding siblings ...)
2025-06-27 7:59 ` [PATCH BlueZ 5/9] mesh: mesh_net_transport_send: simplify Christian Eggers
@ 2025-06-27 7:59 ` Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 7/9] mesh: remove unused function typedef Christian Eggers
` (4 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Christian Eggers @ 2025-06-27 7:59 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Christian Eggers
No need for using a void pointer here. Add const qualifier to passed
mesh_prov_node_info.
---
mesh/manager.c | 2 +-
mesh/mesh.c | 2 +-
mesh/node.c | 9 +++++----
mesh/node.h | 4 +++-
mesh/provision.h | 4 ++--
mesh/remprv-server.c | 2 +-
6 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/mesh/manager.c b/mesh/manager.c
index 63551b4ee4c7..3786f7a8f4cd 100644
--- a/mesh/manager.c
+++ b/mesh/manager.c
@@ -177,7 +177,7 @@ static void send_add_failed(const char *owner, const char *path,
}
static bool add_cmplt(void *user_data, uint8_t status,
- struct mesh_prov_node_info *info)
+ const struct mesh_prov_node_info *info)
{
struct prov_remote_data *pending = user_data;
struct mesh_node *node = pending->node;
diff --git a/mesh/mesh.c b/mesh/mesh.c
index 50059adbed57..354aabaf388e 100644
--- a/mesh/mesh.c
+++ b/mesh/mesh.c
@@ -455,7 +455,7 @@ static void prov_join_complete_reply_cb(struct l_dbus_message *msg,
}
static bool prov_complete_cb(void *user_data, uint8_t status,
- struct mesh_prov_node_info *info)
+ const struct mesh_prov_node_info *info)
{
struct l_dbus *dbus = dbus_get_bus();
struct l_dbus_message *msg;
diff --git a/mesh/node.c b/mesh/node.c
index a85814727d40..65161b7afb3d 100644
--- a/mesh/node.c
+++ b/mesh/node.c
@@ -1412,8 +1412,9 @@ static void save_pages(void *data, void *user_data)
}
static bool add_local_node(struct mesh_node *node, uint16_t unicast, bool kr,
- bool ivu, uint32_t iv_idx, uint8_t dev_key[16],
- uint16_t net_key_idx, uint8_t net_key[16])
+ bool ivu, uint32_t iv_idx,
+ const uint8_t dev_key[16],
+ uint16_t net_key_idx, const uint8_t net_key[16])
{
if (!nodes)
nodes = l_queue_new();
@@ -2493,9 +2494,9 @@ const char *node_get_element_path(struct mesh_node *node, uint8_t ele_idx)
return ele->path;
}
-bool node_add_pending_local(struct mesh_node *node, void *prov_node_info)
+bool node_add_pending_local(struct mesh_node *node,
+ const struct mesh_prov_node_info *info)
{
- struct mesh_prov_node_info *info = prov_node_info;
bool kr = !!(info->flags & PROV_FLAG_KR);
bool ivu = !!(info->flags & PROV_FLAG_IVU);
diff --git a/mesh/node.h b/mesh/node.h
index 4f31c5056dfd..cba51cb93bbb 100644
--- a/mesh/node.h
+++ b/mesh/node.h
@@ -14,6 +14,7 @@ struct mesh_io;
struct mesh_agent;
struct mesh_config;
struct mesh_config_node;
+struct mesh_prov_node_info;
typedef void (*node_ready_func_t) (void *user_data, int status,
struct mesh_node *node);
@@ -71,7 +72,8 @@ uint8_t node_friend_mode_get(struct mesh_node *node);
const char *node_get_element_path(struct mesh_node *node, uint8_t ele_idx);
const char *node_get_owner(struct mesh_node *node);
const char *node_get_app_path(struct mesh_node *node);
-bool node_add_pending_local(struct mesh_node *node, void *info);
+bool node_add_pending_local(struct mesh_node *node,
+ const struct mesh_prov_node_info *info);
void node_attach_io_all(struct mesh_io *io);
void node_attach_io(struct mesh_node *node, struct mesh_io *io);
void node_attach(const char *app_root, const char *sender, uint64_t token,
diff --git a/mesh/provision.h b/mesh/provision.h
index cfeb6debab53..3982c8703882 100644
--- a/mesh/provision.h
+++ b/mesh/provision.h
@@ -91,7 +91,7 @@ struct mesh_prov_node_info {
typedef bool (*mesh_prov_acceptor_complete_func_t)(void *user_data,
uint8_t status,
- struct mesh_prov_node_info *info);
+ const struct mesh_prov_node_info *info);
typedef void (*mesh_prov_initiator_start_func_t)(void *user_data, int err);
@@ -100,7 +100,7 @@ typedef bool (*mesh_prov_initiator_data_req_func_t)(void *user_data,
typedef bool (*mesh_prov_initiator_complete_func_t)(void *user_data,
uint8_t status,
- struct mesh_prov_node_info *info);
+ const struct mesh_prov_node_info *info);
typedef void (*mesh_prov_initiator_scan_result_t)(void *user_data,
uint16_t server, bool extended,
diff --git a/mesh/remprv-server.c b/mesh/remprv-server.c
index 53c764f8626a..20a3da343b26 100644
--- a/mesh/remprv-server.c
+++ b/mesh/remprv-server.c
@@ -514,7 +514,7 @@ bool register_nppi_acceptor(mesh_prov_open_func_t open_cb,
}
static bool nppi_cmplt(void *user_data, uint8_t status,
- struct mesh_prov_node_info *info)
+ const struct mesh_prov_node_info *info)
{
struct rem_prov_data *prov = user_data;
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH BlueZ 7/9] mesh: remove unused function typedef
2025-06-27 7:59 [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix Christian Eggers
` (4 preceding siblings ...)
2025-06-27 7:59 ` [PATCH BlueZ 6/9] mesh: node_add_pending_local: use concrete type Christian Eggers
@ 2025-06-27 7:59 ` Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 8/9] net: packet_received: avoid unnecessary copying Christian Eggers
` (3 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Christian Eggers @ 2025-06-27 7:59 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Christian Eggers
mesh_io_recv_ext_func_t has been introduced in
6a6fe856a900 ("mesh: rework incoming advertisement filtering").
According to 'git log -p <rev> master' it has never been used.
---
mesh/mesh-io.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/mesh/mesh-io.h b/mesh/mesh-io.h
index f7711e78635e..d9e0c138328d 100644
--- a/mesh/mesh-io.h
+++ b/mesh/mesh-io.h
@@ -66,11 +66,6 @@ typedef void (*mesh_io_recv_func_t)(void *user_data,
struct mesh_io_recv_info *info,
const uint8_t *data, uint16_t len);
-typedef void (*mesh_io_recv_ext_func_t)(void *user_data,
- struct mesh_io_recv_info *info,
- const uint8_t *data, uint16_t len,
- const uint8_t *addr);
-
typedef void (*mesh_io_ready_func_t)(void *user_data, bool result);
struct mesh_io *mesh_io_new(enum mesh_io_type type, void *opts,
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH BlueZ 8/9] net: packet_received: avoid unnecessary copying
2025-06-27 7:59 [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix Christian Eggers
` (5 preceding siblings ...)
2025-06-27 7:59 ` [PATCH BlueZ 7/9] mesh: remove unused function typedef Christian Eggers
@ 2025-06-27 7:59 ` Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 9/9] tools: parser: fix printf format errors Christian Eggers
` (2 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Christian Eggers @ 2025-06-27 7:59 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Christian Eggers
Since cca48f305b60 ("mesh: Fix Relaying for multiple nodes"), the packet
for relaying is assembled within send_relay_pkt(). So we do not need to
assemble a full packet within packet_received().
Additionally remove misleading initialization of 'msg' variable, the
value is assigned in all possible branches of
mesh_crypto_packet_parse().
---
mesh/net.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/mesh/net.c b/mesh/net.c
index f26a63f178c2..1cf74c892ca0 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -2324,25 +2324,21 @@ static void send_msg_pkt(struct mesh_net *net, uint8_t cnt, uint16_t interval,
l_idle_oneshot(send_msg_pkt_oneshot, tx, NULL);
}
-static enum _relay_advice packet_received(void *user_data,
+static enum _relay_advice packet_received(struct mesh_net *net,
uint32_t net_key_id, uint16_t net_idx,
bool frnd, uint32_t iv_index,
- const void *data, uint8_t size, int8_t rssi)
+ const uint8_t *data, uint8_t size, int8_t rssi)
{
- struct mesh_net *net = user_data;
- const uint8_t *msg = data;
+ const uint8_t *msg;
uint8_t app_msg_len;
uint8_t net_ttl, key_aid, net_segO, net_segN, net_opcode;
uint32_t net_seq, cache_cookie;
uint16_t net_src, net_dst, net_seqZero;
- uint8_t packet[31];
bool net_ctl, net_segmented, net_szmic, net_relay;
- memcpy(packet + 2, data, size);
-
- print_packet("RX: Network [clr] :", packet + 2, size);
+ print_packet("RX: Network [clr] :", data, size);
- if (!mesh_crypto_packet_parse(packet + 2, size, &net_ctl, &net_ttl,
+ if (!mesh_crypto_packet_parse(data, size, &net_ctl, &net_ttl,
&net_seq, &net_src, &net_dst,
&cache_cookie, &net_opcode,
&net_segmented, &key_aid, &net_szmic,
@@ -2418,7 +2414,7 @@ static enum _relay_advice packet_received(void *user_data,
if (net_ttl >= 2) {
friend_seg_rxed(net, iv_index, net_ttl,
net_seq, net_src, net_dst,
- l_get_be32(packet + 2 + 9),
+ l_get_be32(data + 9),
msg, app_msg_len);
}
} else {
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH BlueZ 9/9] tools: parser: fix printf format errors
2025-06-27 7:59 [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix Christian Eggers
` (6 preceding siblings ...)
2025-06-27 7:59 ` [PATCH BlueZ 8/9] net: packet_received: avoid unnecessary copying Christian Eggers
@ 2025-06-27 7:59 ` Christian Eggers
2025-06-27 9:32 ` [BlueZ,1/9] doc: mesh-api: minor copy&paste fix bluez.test.bot
2025-06-27 17:00 ` [PATCH BlueZ 1/9] " patchwork-bot+bluetooth
9 siblings, 0 replies; 12+ messages in thread
From: Christian Eggers @ 2025-06-27 7:59 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Christian Eggers
struct timeval members can be 32 or 64 bits which results in "long long
int" on some platforms. As there are no printf conversion specifiers for
time types, cast them to the longest possible types.
---
tools/parser/parser.h | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/tools/parser/parser.h b/tools/parser/parser.h
index 5f65f1689447..cd6268acb893 100644
--- a/tools/parser/parser.h
+++ b/tools/parser/parser.h
@@ -120,11 +120,14 @@ static inline void p_indent(int level, struct frame *f)
struct tm tm;
time_t t = f->ts.tv_sec;
localtime_r(&t, &tm);
- printf("%04d-%02d-%02d %02d:%02d:%02d.%06lu ",
+ printf("%04d-%02d-%02d %02d:%02d:%02d.%06lld ",
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
- tm.tm_hour, tm.tm_min, tm.tm_sec, f->ts.tv_usec);
+ tm.tm_hour, tm.tm_min, tm.tm_sec,
+ (long long int)f->ts.tv_usec);
} else
- printf("%8lu.%06lu ", f->ts.tv_sec, f->ts.tv_usec);
+ printf("%8lld.%06lld ",
+ (long long int)f->ts.tv_sec,
+ (long long int)f->ts.tv_usec);
}
printf("%c ", (f->in ? '>' : '<'));
parser.state = 1;
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* RE: [BlueZ,1/9] doc: mesh-api: minor copy&paste fix
2025-06-27 7:59 [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix Christian Eggers
` (7 preceding siblings ...)
2025-06-27 7:59 ` [PATCH BlueZ 9/9] tools: parser: fix printf format errors Christian Eggers
@ 2025-06-27 9:32 ` bluez.test.bot
2025-06-27 17:00 ` [PATCH BlueZ 1/9] " patchwork-bot+bluetooth
9 siblings, 0 replies; 12+ messages in thread
From: bluez.test.bot @ 2025-06-27 9:32 UTC (permalink / raw)
To: linux-bluetooth, ceggers
[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=976514
---Test result---
Test Summary:
CheckPatch PENDING 0.35 seconds
GitLint PENDING 0.35 seconds
BuildEll PASS 19.97 seconds
BluezMake PASS 2655.92 seconds
MakeCheck PASS 20.50 seconds
MakeDistcheck PASS 198.04 seconds
CheckValgrind PASS 274.38 seconds
CheckSmatch PASS 303.68 seconds
bluezmakeextell PASS 127.34 seconds
IncrementalBuild PENDING 0.37 seconds
ScanBuild PASS 909.61 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix
2025-06-27 7:59 [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix Christian Eggers
` (8 preceding siblings ...)
2025-06-27 9:32 ` [BlueZ,1/9] doc: mesh-api: minor copy&paste fix bluez.test.bot
@ 2025-06-27 17:00 ` patchwork-bot+bluetooth
9 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+bluetooth @ 2025-06-27 17:00 UTC (permalink / raw)
To: Christian Eggers; +Cc: linux-bluetooth
Hello:
This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Fri, 27 Jun 2025 09:59:20 +0200 you wrote:
> ---
> doc/mesh-api.txt | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [BlueZ,1/9] doc: mesh-api: minor copy&paste fix
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=6983c985e08a
- [BlueZ,2/9] mesh: keyring: constify
(no matching commit)
- [BlueZ,3/9] mesh: mesh-config: constify
(no matching commit)
- [BlueZ,4/9] mesh: util: constify
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=b913bd1b92a4
- [BlueZ,5/9] mesh: mesh_net_transport_send: simplify
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=725a72ea654c
- [BlueZ,6/9] mesh: node_add_pending_local: use concrete type
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=2874aeb4d056
- [BlueZ,7/9] mesh: remove unused function typedef
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=2a40b2f8e07a
- [BlueZ,8/9] net: packet_received: avoid unnecessary copying
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=2251e6d79620
- [BlueZ,9/9] tools: parser: fix printf format errors
(no matching commit)
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-06-27 16:59 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-27 7:59 [PATCH BlueZ 1/9] doc: mesh-api: minor copy&paste fix Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 2/9] mesh: keyring: constify Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 3/9] mesh: mesh-config: constify Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 4/9] mesh: util: constify Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 5/9] mesh: mesh_net_transport_send: simplify Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 6/9] mesh: node_add_pending_local: use concrete type Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 7/9] mesh: remove unused function typedef Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 8/9] net: packet_received: avoid unnecessary copying Christian Eggers
2025-06-27 7:59 ` [PATCH BlueZ 9/9] tools: parser: fix printf format errors Christian Eggers
2025-06-27 9:32 ` [BlueZ,1/9] doc: mesh-api: minor copy&paste fix bluez.test.bot
2025-06-27 17:00 ` [PATCH BlueZ 1/9] " patchwork-bot+bluetooth
-- strict thread matches above, loose matches on Subject: below --
2025-06-27 7:57 Christian Eggers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox