libosmocore/src/codec
Philipp Maier 9b1e22d8d5 ecu: fix alignment of fr_ecu_state
The member data[0] in struct osmo_ecu_state is used as an anchor to
attach private structs for a concrete ECU implementation. This works by
allocating more memory then struct osmo_ecu_state actually needs and
then using the excess memory to store the private struct of the concrete
ECU implementation.

However, this poses a problem since data[0] is at the end of the struct
it may land in an unaligned position. This also means that the struct we
store there is also unaligned.

We should fix this enclosing the public struct osmo_ecu_state into our
private struct fr_ecu_state. Then we can use container_of to cast from
osmo_ecu_state to fr_ecu_state and correct alignment is ensured as well.

Related: OS#6286
Change-Id: I28672856e8e8f47e04ffe09ee3e07b577108cdc7
2024-01-04 13:55:31 +01:00
..
Makefile.am Bump version: 1.8.0.252-13c29 → 1.9.0 2023-09-12 13:15:54 +02:00
ecu.c ecu: add is_dtx_pause() method 2023-06-23 18:42:11 +00:00
ecu_fr.c ecu: fix alignment of fr_ecu_state 2024-01-04 13:55:31 +01:00
ecu_fr_old.c codec cosmetic: move old FR ECU code to ecu_fr_old.c 2023-05-17 13:53:20 +00:00
gsm610.c codec: new functions osmo_{fr,efr}_sid_reset() 2023-05-27 10:49:41 +00:00
gsm620.c codec: new function osmo_hr_sid_reset() 2023-05-27 10:51:17 +00:00
gsm660.c codec: new functions osmo_{fr,efr}_sid_reset() 2023-05-27 10:49:41 +00:00
gsm690.c treewide: remove FSF address 2021-12-14 12:44:03 +01:00