* [PATCH BlueZ v2 1/3] mesh: Add interface output filter
@ 2022-09-21 11:16 Isak Westin
2022-09-21 12:09 ` [BlueZ,v2,1/3] " bluez.test.bot
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Isak Westin @ 2022-09-21 11:16 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Isak Westin
According to the mesh profile (3.4.5.2), if TTL is set to 1 for an
outgoing message, that message shall be dropped.
---
mesh/net.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/mesh/net.c b/mesh/net.c
index e8e6d3a61..699469284 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -3067,6 +3067,13 @@ void mesh_net_send_seg(struct mesh_net *net, uint32_t net_key_id,
uint8_t segO = (hdr >> SEGO_HDR_SHIFT) & SEG_MASK;
uint8_t segN = (hdr >> SEGN_HDR_SHIFT) & SEG_MASK;
+ /*
+ * MshPRFv1.0.1 section 3.4.5.2, Interface output filter:
+ * If TTL is set to 1, message shall be dropped.
+ */
+ if (ttl == 1)
+ return;
+
/* TODO: Only used for current POLLed segments to LPNs */
l_debug("SEQ: %6.6x", seq + segO);
@@ -3135,6 +3142,13 @@ bool mesh_net_app_send(struct mesh_net *net, bool frnd_cred, uint16_t src,
(dst >= net->src_addr && dst <= net->last_addr))
return true;
+ /*
+ * MshPRFv1.0.1 section 3.4.5.2, Interface output filter:
+ * If TTL is set to 1, message shall be dropped.
+ */
+ if (ttl == 1)
+ return true;
+
/* Setup OTA Network send */
payload = mesh_sar_new(msg_len);
memcpy(payload->buf, msg, msg_len);
@@ -3206,6 +3220,13 @@ void mesh_net_ack_send(struct mesh_net *net, uint32_t net_key_id,
uint8_t pkt_len;
uint8_t pkt[30];
+ /*
+ * MshPRFv1.0.1 section 3.4.5.2, Interface output filter:
+ * If TTL is set to 1, message shall be dropped.
+ */
+ if (ttl == 1)
+ return;
+
hdr = NET_OP_SEG_ACKNOWLEDGE << OPCODE_HDR_SHIFT;
hdr |= rly << RELAY_HDR_SHIFT;
hdr |= (seqZero & SEQ_ZERO_MASK) << SEQ_ZERO_HDR_SHIFT;
@@ -3264,6 +3285,13 @@ void mesh_net_transport_send(struct mesh_net *net, uint32_t net_key_id,
if (*msg & 0xc0 || (9 + msg_len + 8 > 29))
return;
+ /*
+ * MshPRFv1.0.1 section 3.4.5.2, Interface output filter:
+ * If TTL is set to 1, message shall be dropped.
+ */
+ if (ttl == 1)
+ return;
+
/* Enqueue for Friend if forwardable and from us */
if (!net_key_id && src >= net->src_addr && src <= net->last_addr) {
uint32_t hdr = msg[0] << OPCODE_HDR_SHIFT;
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: [BlueZ,v2,1/3] mesh: Add interface output filter
2022-09-21 11:16 [PATCH BlueZ v2 1/3] mesh: Add interface output filter Isak Westin
@ 2022-09-21 12:09 ` bluez.test.bot
2022-09-22 21:10 ` [PATCH BlueZ v2 1/3] " patchwork-bot+bluetooth
2022-09-22 21:11 ` Gix, Brian
2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2022-09-21 12:09 UTC (permalink / raw)
To: linux-bluetooth, isak.westin
[-- Attachment #1: Type: text/plain, Size: 1049 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=679006
---Test result---
Test Summary:
CheckPatch PASS 2.01 seconds
GitLint PASS 1.40 seconds
Prep - Setup ELL PASS 30.17 seconds
Build - Prep PASS 0.63 seconds
Build - Configure PASS 9.86 seconds
Build - Make PASS 897.95 seconds
Make Check PASS 11.76 seconds
Make Check w/Valgrind PASS 308.60 seconds
Make Distcheck PASS 255.88 seconds
Build w/ext ELL - Configure PASS 9.26 seconds
Build w/ext ELL - Make PASS 89.46 seconds
Incremental Build w/ patches PASS 313.90 seconds
Scan Build PASS 553.99 seconds
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH BlueZ v2 1/3] mesh: Add interface output filter
2022-09-21 11:16 [PATCH BlueZ v2 1/3] mesh: Add interface output filter Isak Westin
2022-09-21 12:09 ` [BlueZ,v2,1/3] " bluez.test.bot
@ 2022-09-22 21:10 ` patchwork-bot+bluetooth
2022-09-22 21:11 ` Gix, Brian
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2022-09-22 21:10 UTC (permalink / raw)
To: Isak Westin; +Cc: linux-bluetooth
Hello:
This series was applied to bluetooth/bluez.git (master)
by Brian Gix <brian.gix@intel.com>:
On Wed, 21 Sep 2022 13:16:28 +0200 you wrote:
> According to the mesh profile (3.4.5.2), if TTL is set to 1 for an
> outgoing message, that message shall be dropped.
> ---
> mesh/net.c | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
Here is the summary with links:
- [BlueZ,v2,1/3] mesh: Add interface output filter
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=a76ff5879b75
- [BlueZ,v2,2/3] mesh: Do not accept publication for unbound appkey
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=b72edcc5ca6f
- [BlueZ,v2,3/3] mesh: Remove RFU check for publication set
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=c9fadca7eba4
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] 4+ messages in thread
* Re: [PATCH BlueZ v2 1/3] mesh: Add interface output filter
2022-09-21 11:16 [PATCH BlueZ v2 1/3] mesh: Add interface output filter Isak Westin
2022-09-21 12:09 ` [BlueZ,v2,1/3] " bluez.test.bot
2022-09-22 21:10 ` [PATCH BlueZ v2 1/3] " patchwork-bot+bluetooth
@ 2022-09-22 21:11 ` Gix, Brian
2 siblings, 0 replies; 4+ messages in thread
From: Gix, Brian @ 2022-09-22 21:11 UTC (permalink / raw)
To: isak.westin, linux-bluetooth
Patchset v2 applied. Thanks!
On Wed, 2022-09-21 at 13:16 +0200, Isak Westin wrote:
> According to the mesh profile (3.4.5.2), if TTL is set to 1 for an
> outgoing message, that message shall be dropped.
> ---
> mesh/net.c | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
>
> diff --git a/mesh/net.c b/mesh/net.c
> index e8e6d3a61..699469284 100644
> --- a/mesh/net.c
> +++ b/mesh/net.c
> @@ -3067,6 +3067,13 @@ void mesh_net_send_seg(struct mesh_net *net,
> uint32_t net_key_id,
> uint8_t segO = (hdr >> SEGO_HDR_SHIFT) & SEG_MASK;
> uint8_t segN = (hdr >> SEGN_HDR_SHIFT) & SEG_MASK;
>
> + /*
> + * MshPRFv1.0.1 section 3.4.5.2, Interface output filter:
> + * If TTL is set to 1, message shall be dropped.
> + */
> + if (ttl == 1)
> + return;
> +
> /* TODO: Only used for current POLLed segments to LPNs */
>
> l_debug("SEQ: %6.6x", seq + segO);
> @@ -3135,6 +3142,13 @@ bool mesh_net_app_send(struct mesh_net *net,
> bool frnd_cred, uint16_t src,
> (dst >= net->src_addr && dst <= net-
> >last_addr))
> return true;
>
> + /*
> + * MshPRFv1.0.1 section 3.4.5.2, Interface output filter:
> + * If TTL is set to 1, message shall be dropped.
> + */
> + if (ttl == 1)
> + return true;
> +
> /* Setup OTA Network send */
> payload = mesh_sar_new(msg_len);
> memcpy(payload->buf, msg, msg_len);
> @@ -3206,6 +3220,13 @@ void mesh_net_ack_send(struct mesh_net *net,
> uint32_t net_key_id,
> uint8_t pkt_len;
> uint8_t pkt[30];
>
> + /*
> + * MshPRFv1.0.1 section 3.4.5.2, Interface output filter:
> + * If TTL is set to 1, message shall be dropped.
> + */
> + if (ttl == 1)
> + return;
> +
> hdr = NET_OP_SEG_ACKNOWLEDGE << OPCODE_HDR_SHIFT;
> hdr |= rly << RELAY_HDR_SHIFT;
> hdr |= (seqZero & SEQ_ZERO_MASK) << SEQ_ZERO_HDR_SHIFT;
> @@ -3264,6 +3285,13 @@ void mesh_net_transport_send(struct mesh_net
> *net, uint32_t net_key_id,
> if (*msg & 0xc0 || (9 + msg_len + 8 > 29))
> return;
>
> + /*
> + * MshPRFv1.0.1 section 3.4.5.2, Interface output filter:
> + * If TTL is set to 1, message shall be dropped.
> + */
> + if (ttl == 1)
> + return;
> +
> /* Enqueue for Friend if forwardable and from us */
> if (!net_key_id && src >= net->src_addr && src <= net-
> >last_addr) {
> uint32_t hdr = msg[0] << OPCODE_HDR_SHIFT;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-09-22 21:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-21 11:16 [PATCH BlueZ v2 1/3] mesh: Add interface output filter Isak Westin
2022-09-21 12:09 ` [BlueZ,v2,1/3] " bluez.test.bot
2022-09-22 21:10 ` [PATCH BlueZ v2 1/3] " patchwork-bot+bluetooth
2022-09-22 21:11 ` Gix, Brian
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.