[riot-notifications] [RIOT-OS/RIOT] Initial implementation of IEEE 802.15.4 security (#15150)
benpicco
notifications at github.com
Wed Nov 4 15:20:26 CET 2020
@benpicco commented on this pull request.
> + if (*header_size + payload_size >
+ /* TODO: support 802.15.4g frame sizes */
+ (IEEE802154_FRAME_LEN_MAX
+ - IEEE802154_MAX_AUX_HDR_LEN
+ - IEEE802154_FCS_LEN)) {
+ return -IEEE802154_SEC_FRAME_TOO_LARGE;
+ }
Actually you can drop that check if you instead add
```patch
--- a/drivers/netdev/ieee802154.c
+++ b/drivers/netdev/ieee802154.c
@@ -177,6 +177,9 @@ int netdev_ieee802154_get(netdev_ieee802154_t *dev, netopt_t opt, void *value,
*((uint16_t *)value) = (_get_ieee802154_pdu(dev)
- IEEE802154_MAX_HDR_LEN)
+#ifdef IEEE802154_SECURITY
+ - IEEE802154_MAX_AUX_HDR_LEN
+#endif
- IEEE802154_FCS_LEN;
res = sizeof(uint16_t);
break;
```
That also solves the issue with 802.15.4g frames and prevents too large fragments from being generated in the first place.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15150#pullrequestreview-523404482
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201104/af269f3d/attachment.htm>
More information about the notifications
mailing list