public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Gix, Brian" <brian.gix@intel.com>
To: "isak.westin@hotmail.com" <isak.westin@hotmail.com>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ v2 1/3] mesh: Add interface output filter
Date: Thu, 22 Sep 2022 21:11:08 +0000	[thread overview]
Message-ID: <c19b921f0d785793d9fd0e4ff0d66c8a66dbd9cb.camel@intel.com> (raw)
In-Reply-To: <VI1PR09MB42395F76D2702B0C26F326C2E34F9@VI1PR09MB4239.eurprd09.prod.outlook.com>

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;


      parent reply	other threads:[~2022-09-22 21:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c19b921f0d785793d9fd0e4ff0d66c8a66dbd9cb.camel@intel.com \
    --to=brian.gix@intel.com \
    --cc=isak.westin@hotmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox