diff options
| author | Felix Dörre <felix@dogcraft.de> | 2022-08-25 17:25:08 +0000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2024-02-16 11:46:40 +1100 |
| commit | 628abf8f25a7705a2810fffe2ca6ae652c532896 (patch) | |
| tree | f7e07475d1cd733e411e77b0f2563fac78219a1b /extmod/network_cyw43.c | |
| parent | 866fc3447c7a685c6c04d6a03ee94083b8d0dd72 (diff) | |
extmod/modlwip: Support IPv6.
With these changes IPv6 works on the rp2 port (and possibly others that use
the lwIP socket implementation).
Things that have been tested and work:
- Neighbour solicitation for v6 link local address.
- Ping of v6 link-local address.
- Receiving a SLAAC address via router advertisement.
- Ping a v6 address allocated via SLAAC.
- Perform an outgoing connection to a routed v6-address (via default
gateway).
- Create a listening IPv6 wildcard socked bound to ::, and trying to access
it via link-local, SLAAC, and IPv4 (to ensure the dual-stack binding
works).
Things that could be improved:
- socket.socket().getaddrinfo only returns the v4 address. It could also
return v6 addresses (getaddrinfo is actively programmed to only return a
single address, and this is the v4-address by default, with fallback to
the v6 address if both are enabled).
Signed-off-by: Felix Dörre <felix@dogcraft.de>
Diffstat (limited to 'extmod/network_cyw43.c')
| -rw-r--r-- | extmod/network_cyw43.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/extmod/network_cyw43.c b/extmod/network_cyw43.c index f8490d6b9..2f188dbad 100644 --- a/extmod/network_cyw43.c +++ b/extmod/network_cyw43.c @@ -78,13 +78,14 @@ STATIC void network_cyw43_print(const mp_print_t *print, mp_obj_t self_in, mp_pr } else { status_str = "fail"; } + ip4_addr_t *addr = ip_2_ip4(&netif->ip_addr); mp_printf(print, "<CYW43 %s %s %u.%u.%u.%u>", self->itf == CYW43_ITF_STA ? "STA" : "AP", status_str, - netif->ip_addr.addr & 0xff, - netif->ip_addr.addr >> 8 & 0xff, - netif->ip_addr.addr >> 16 & 0xff, - netif->ip_addr.addr >> 24 + addr->addr & 0xff, + addr->addr >> 8 & 0xff, + addr->addr >> 16 & 0xff, + addr->addr >> 24 ); } |
