From: "Gix, Brian" <brian.gix@intel.com>
To: Michal Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
Cc: "linux-bluetooth@vger.kernel.org"
<linux-bluetooth@vger.kernel.org>,
"Stotland, Inga" <inga.stotland@intel.com>
Subject: RE: [PATCH BlueZ 6/8] mesh: Fix implementation of Provisioner Initiator
Date: Thu, 11 Jul 2019 15:48:00 +0000 [thread overview]
Message-ID: <DEBB0CAA2616974FAE35E4B560B9A4376CBCCF12@ORSMSX103.amr.corp.intel.com> (raw)
In-Reply-To: <20190711073329.osw52lx72muov6sg@mlowasrzechonek2133>
Hi Michał,
I will fix the style guide and spec alignment issues you pointed at elsewhere...
> -----Original Message-----
> > + if (key.phase == KEY_REFRESH_PHASE_TWO) {
> > + memcpy(out + 1, key.new_key, 16);
> > + snb_flags |= PROV_FLAG_KR;
> > + } else
> > + memcpy(out + 1, key.old_key, 16);
> > +
> > + l_put_be16(net_idx, out + 1 + 16);
> > + l_put_u8(snb_flags, out + 1 + 16 + 2);
> > + l_put_be32(iv_index, out + 1 + 16 + 2 + 1);
> > + l_put_be16(primary, out + 1 + 16 + 2 + 1 + 4);
>
> Not really related to this patchset, but a general comment about packet
> building and parsing: could we please move away from calculating byte offsets
> and use packed structs instead? Do you have any opinion on that?
You are probably right about this. Technically, this is a "Network Packet" (even though
we locally encrypt it before sending) and so we should treat it like any packet we
send over a socket (for instance, the HCI sockets we use to talk to controllers). This is
a vestige of my "old man engineering" where I couldn't always trust compilers across
all platforms to faithfully pack octets the same, but obviously if we are trusting the
packing for HCI, we should be trusting the packing for this. I will scrub the code for
opportunities for packing this (and other similar) structures.
next prev parent reply other threads:[~2019-07-11 15:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-10 23:07 [PATCH BlueZ 0/8] mesh: Provisioner Initiator added Brian Gix
2019-07-10 23:07 ` [PATCH BlueZ 1/8] doc: Cleanup API Provisioner1 interface Brian Gix
2019-07-10 23:07 ` [PATCH BlueZ 2/8] mesh: Fix support for Provisioner Initiator Brian Gix
2019-07-11 7:10 ` Michał Lowas-Rzechonek
2019-07-10 23:07 ` [PATCH BlueZ 3/8] mesh: Add special Beacon handler for Provisioning Brian Gix
2019-07-10 23:07 ` [PATCH BlueZ 4/8] mesh: Expose mapping function for D-Bus errors Brian Gix
2019-07-10 23:07 ` [PATCH BlueZ 5/8] mesh: Expose resources needed by Management1 interface Brian Gix
2019-07-10 23:07 ` [PATCH BlueZ 6/8] mesh: Fix implementation of Provisioner Initiator Brian Gix
2019-07-11 7:33 ` Michał Lowas-Rzechonek
2019-07-11 15:48 ` Gix, Brian [this message]
2019-07-10 23:07 ` [PATCH BlueZ 7/8] mesh: Implement DBus Provisioning methods Brian Gix
2019-07-10 23:07 ` [PATCH BlueZ 8/8] test: This extends the mesh tool to exercise " Brian Gix
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=DEBB0CAA2616974FAE35E4B560B9A4376CBCCF12@ORSMSX103.amr.corp.intel.com \
--to=brian.gix@intel.com \
--cc=inga.stotland@intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=michal.lowas-rzechonek@silvair.com \
/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;
as well as URLs for NNTP newsgroup(s).