net: l2: ieee802154: pkt: fix cpp build failure#62314
net: l2: ieee802154: pkt: fix cpp build failure#62314carlescufi merged 1 commit intomainfrom unknown repository
Conversation
|
The test failures seem to be unrelated to this change. I can reproduce them locally on main. Not sure what's going on. Mainline broken? See #62317 |
|
Fixed now in mainline, please re-submit. |
CPP needs an additional cast. Fixes: #62282 Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
|
@cfriedt ACK? :-) |
cfriedt
left a comment
There was a problem hiding this comment.
LGTM. Although AFAICT, 802.15.4 is the only consumer of this field. Even if the intent were to allow other L2s to override it, it isn't possible with the current struct. So maybe some future cleanup in the net code, but this works for now
@cfriedt @rlubos Yes agreed - it was a conscious choice. There is a comment at that field that gives the rationale: Robert and I tried to find a compromise that is not prematurely abstract but still architecturally way better than the previous solution. We now only depend on a single IEEE 802.15.4 specific field (and one conditional include) rather than globally exposing tens of IEEE 802.15.4 specific fields. Plus we can use memcpy to clone the whole well-encapsulated block rather than having to clone field by field which broke encapsulation even more and had to be updated with every new field (which is easy to forget). It is trivial to change this field in the future to a union of conditionally included control block versions if other L2s want to have their own. Linux has a pre-allocated untyped array of 40 bytes as a control block but that's not acceptable in the embedded world IMO. We could have introduced a union right away but that's not nice with a single field. I discussed several versions of this with Robert and we agreed that that was a good middle ground for now. |
ieee802154_pkt.h: Add cast to support CPP.
Fixes: #62282