Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jan 12, 2023

As we have to provide LL addresses in big endian to userspace to be POSIX compliant and we also do not want to reserve extra space for such addresses, bff6a5c introduced a change that swaps address bytes in place in the packet before returning the packet with LL address pointers to userspace.

Unfortunately a regression sneaked into the code base while doing so: The byte swapping was duplicated when using 6LoWPAN compression and the byte swapping caused decryption to fail in some cases, see #53630. This PR fixes the problem.

As we have to provide LL addresses in big endian to userspace to be
POSIX compliant and we also do not want to reserve extra space for
such addresses, bff6a5c introduced
a change that swaps address bytes in place in the packet before
returning the packet with LL address pointers to userspace.

Unfortunately a regression sneaked into the code base while doing
so: The byte swapping was duplicated when using 6LoWPAN compression
and the byte swapping caused decryption to fail in some cases,
see #53630. This commit fixes the problem.

Fixes: #53630

Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
Copy link
Member

@jukkar jukkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@rlubos rlubos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @fgrandel.

@carlescufi carlescufi merged commit e854314 into zephyrproject-rtos:main Jan 12, 2023
@ghost ghost deleted the fix/53630-ieee802154-byte-swapping branch January 13, 2023 14:58
fabiobaltieri pushed a commit that referenced this pull request Sep 19, 2024
The L2 function `ieee802154_decipher_data_frame()` relied on upper layer
LL address fields which breaks encapsulation.

Also fixes a bug introduced in another fix that went overboard (#53734).

Fixes: #78490

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
zephyrbot pushed a commit that referenced this pull request Sep 19, 2024
The L2 function `ieee802154_decipher_data_frame()` relied on upper layer
LL address fields which breaks encapsulation.

Also fixes a bug introduced in another fix that went overboard (#53734).

Fixes: #78490

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
(cherry picked from commit da0371a)
nashif pushed a commit that referenced this pull request Sep 26, 2024
The L2 function `ieee802154_decipher_data_frame()` relied on upper layer
LL address fields which breaks encapsulation.

Also fixes a bug introduced in another fix that went overboard (#53734).

Fixes: #78490

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
(cherry picked from commit da0371a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

net: ieee802154_6lo: REGRESSION: L2 MAC byte swapping results in wrong IPHC decompression

4 participants