Commit 8b8df3d
net: Fix checksum, part 3
The code was breaking aliasing rules when called from
net_ipv4_checksum_pseudo(), as the struct address was indirectly casted
to a uint16_t pointer, causing GCC to not bother emit the proper code
for the undefined behaviour.
Address this issue by using a locally defined uint16_t type that is
allowed to alias.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>1 parent 73f25c9 commit 8b8df3d
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | | - | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
0 commit comments