Skip to content
Snippets Groups Projects
Unverified Commit 910b0880 authored by Koen Zandberg's avatar Koen Zandberg Committed by GitHub
Browse files

Merge pull request #10172 from miri64/tests/fix/lwip_sock_array_address

tests/lwip_sock_{i,ud}p: correctly get array address
parents 8b2d295a bf8ebbac
No related branches found
No related tags found
No related merge requests found
......@@ -197,9 +197,16 @@ void _net_init(void)
netif_add(&netif, &netdev, lwip_netdev_init, tcpip_input);
#endif
#if LWIP_IPV6
static const uint8_t local6[] = _TEST_ADDR6_LOCAL;
static const uint8_t local6_a[] = _TEST_ADDR6_LOCAL;
/* XXX need to copy into a stack variable. Otherwise, when just using
* `local6_a` this leads to weird alignment problems on some platforms with
* netif_add_ip6_address() below */
ip6_addr_t local6;
s8_t idx;
netif_add_ip6_address(&netif, (ip6_addr_t *)&local6, &idx);
memcpy(&local6.addr, local6_a, sizeof(local6));
ip6_addr_clear_zone(&local6);
netif_add_ip6_address(&netif, &local6, &idx);
for (int i = 0; i <= idx; i++) {
netif.ip6_addr_state[i] |= IP6_ADDR_VALID;
}
......
......@@ -199,9 +199,16 @@ void _net_init(void)
netif_add(&netif, &netdev, lwip_netdev_init, tcpip_input);
#endif
#if LWIP_IPV6
static const uint8_t local6[] = _TEST_ADDR6_LOCAL;
static const uint8_t local6_a[] = _TEST_ADDR6_LOCAL;
/* XXX need to copy into a stack variable. Otherwise, when just using
* `local6_a` this leads to weird alignment problems on some platforms with
* netif_add_ip6_address() below */
ip6_addr_t local6;
s8_t idx;
netif_add_ip6_address(&netif, (ip6_addr_t *)&local6, &idx);
memcpy(&local6.addr, local6_a, sizeof(local6));
ip6_addr_clear_zone(&local6);
netif_add_ip6_address(&netif, &local6, &idx);
for (int i = 0; i <= idx; i++) {
netif.ip6_addr_state[i] |= IP6_ADDR_VALID;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment