Skip to content

Commit 152a03b

Browse files
jukkarkartben
authored andcommitted
doc: net: Add link address change info to migration guide
Add information about "struct net_linkaddr" changes to 4.2 migration guide to help the developers to handle issues if they access the net_linkaddr struct fields directly in their code. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
1 parent ac3cb9d commit 152a03b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/releases/migration-guide-4.2.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,18 @@ Bluetooth Host
145145
Networking
146146
**********
147147

148+
* The struct ``net_linkaddr_storage`` has been renamed to struct
149+
:c:struct:`net_linkaddr` and the old struct ``net_linkaddr`` has been removed.
150+
The struct :c:struct:`net_linkaddr` now contains space to store the link
151+
address instead of having pointer that point to the link address. This avoids
152+
possible dangling pointers when cloning struct :c:struct:`net_pkt`. This will
153+
increase the size of struct :c:struct:`net_pkt` by 4 octets for IEEE 802.15.4,
154+
but there is no size increase for other network technologies like Ethernet.
155+
Note that any code that is using struct :c:struct:`net_linkaddr` directly, and
156+
which has checks like ``if (lladdr->addr == NULL)``, will no longer work as expected
157+
(because the addr is not a pointer) and must be changed to ``if (lladdr->len == 0)``
158+
if the code wants to check that the link address is not set.
159+
148160
Other subsystems
149161
****************
150162

0 commit comments

Comments
 (0)