Open OlegHahm opened 2 years ago
The socket layer might not be ready for dualstack - I would still expect receiving traffic to work though. Can you paste the output you get (from both IPv4 and IPv6 peers when dualstack is enabled for lwIP)?
Can you try reproducing it with normal DHCP instead of the extra code also? (I don't expect that to fix it)
The tests/lwip_sock_udp
app has separate IPv4 and IPv6 tests, maybe you can expand it to create a test showing the issue.
The socket layer might not be ready for dualstack - I would still expect receiving traffic to work though. Can you paste the output you get (from both IPv4 and IPv6 peers when dualstack is enabled for lwIP)?
Received UDP data from [fe80::a45d:54ff:fe4f:cdd7]:37768
00000000 61 64 66 61 73 64 0A
Received UDP data from [c0a8:4f98::]:51210
00000000 61 64 66 61 73 64 0A
Can you try reproducing it with normal DHCP instead of the extra code also? (I don't expect that to fix it)
The
tests/lwip_sock_udp
app has separate IPv4 and IPv6 tests, maybe you can expand it to create a test showing the issue.
Will do later.
Okay, using DHCP didn't make any difference (as expected), but the first try to create a dualstack test failed and I won't have time to work on it during the next days.
Description
When enabling IPv4 and IPv6 for the lwip test application, some values will default to IPv6.
For example, the formatting of IP addresses will always expect IPv6 addresses and a socket will default to IPv6.
One reason is that in
common.h
you findHence,
SOCK_IP_EP_ANY
is set to IPv6 only.An interesting observation that may lead to an actual bug in the network stack is that IPv4 datagrams are received on the IPv6 only socket nevertheless.
Steps to reproduce the issue
Build the
lwip
test application withLWIP_IPV4=1
. Add something likeat the beginning of the main function and add something like
to the
_udp_recv()
function to echo the received datagram.Build the application on native and assign a matching IPv4 address to the bridge, e.g.,
sudo ip a a 192.168.79.151/24 dev tapbr0
Start the application, start a UDP server and use netcat to send anything to the server.Expected results
In netcat one should the sent packet echoed and in the RIOT shell one should see the IPv4 address (e.g., 192.168.79.151) of the sender.
Actual results
The echo fails and an IPv6 formatted address is printed.
Versions
Test on RIOT 2022.04.
Should be irrelenvant but in any case: