Commit f4c9c2c
batman-adv: Fix incorrect offset in batadv_tt_tvlv_ogm_handler_v1()
Since commit 4436df4 ("batman-adv: Add flex array to struct
batadv_tvlv_tt_data"), the introduction of batadv_tvlv_tt_data's flex
array member in batadv_tt_tvlv_ogm_handler_v1() put tt_changes at
invalid offset. Those TT changes are supposed to be filled from the end
of batadv_tvlv_tt_data structure (including vlan_data flexible array),
but only the flex array size is taken into account missing completely
the size of the fixed part of the structure itself.
Fix the tt_change offset computation by using struct_size() instead of
flex_array_size() so both flex array member and its container structure
sizes are taken into account.
Cc: [email protected]
Fixes: 4436df4 ("batman-adv: Add flex array to struct batadv_tvlv_tt_data")
Signed-off-by: Remi Pommarel <[email protected]>
Signed-off-by: Sven Eckelmann <[email protected]>
Signed-off-by: Simon Wunderlich <[email protected]>1 parent 8c8ecc9 commit f4c9c2c
1 file changed
+5
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3959 | 3959 | | |
3960 | 3960 | | |
3961 | 3961 | | |
3962 | | - | |
| 3962 | + | |
3963 | 3963 | | |
3964 | 3964 | | |
3965 | 3965 | | |
3966 | 3966 | | |
3967 | 3967 | | |
3968 | | - | |
3969 | | - | |
3970 | 3968 | | |
3971 | 3969 | | |
3972 | | - | |
3973 | | - | |
| 3970 | + | |
| 3971 | + | |
3974 | 3972 | | |
3975 | 3973 | | |
3976 | 3974 | | |
3977 | | - | |
3978 | | - | |
| 3975 | + | |
| 3976 | + | |
3979 | 3977 | | |
3980 | 3978 | | |
3981 | 3979 | | |
| |||
0 commit comments