mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 02:10:09 +01:00
platform/tests: avoid accessing in_addr_t via NMIPAddr union
The compiler may dislike this:
CC src/core/platform/tests/libNetworkManagerTest_la-test-common.lo
In function '_ip_address_add',
inlined from 'nmtstp_ip4_address_add' at ../src/core/platform/tests/test-common.c:1892:5:
../src/core/platform/tests/test-common.c:1807:63: error: array subscript 'NMIPAddr {aka const struct _NMIPAddr}[0]' is partly outside array bounds of 'in_addr_t[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
1807 | peer_address->addr4,
| ~~~~~~~~~~~~^~~~~~~
../src/core/platform/tests/test-common.c: In function 'nmtstp_ip4_address_add':
../src/core/platform/tests/test-common.c:1886:36: note: object 'peer_address' of size 4
1886 | in_addr_t peer_address,
| ~~~~~~~~~~~~^~~~~~~~~~~~
...
Fixes: 06aafabf14 ('platform/test: add test adding IPv4 addresses that only differ by their peer-address')
(cherry picked from commit 40dd8bf93a)
This commit is contained in:
parent
fb4de0013a
commit
adca87aba9
1 changed files with 6 additions and 2 deletions
|
|
@ -1891,9 +1891,13 @@ nmtstp_ip4_address_add(NMPlatform *platform,
|
|||
external_command,
|
||||
TRUE,
|
||||
ifindex,
|
||||
(NMIPAddr *) &address,
|
||||
&((NMIPAddr){
|
||||
.addr4 = address,
|
||||
}),
|
||||
plen,
|
||||
(NMIPAddr *) &peer_address,
|
||||
&((NMIPAddr){
|
||||
.addr4 = peer_address,
|
||||
}),
|
||||
lifetime,
|
||||
preferred,
|
||||
flags,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue