test/lwip: enabling both, IPv4 and IPv6, results in unexpected behavior #18097
Labels
Area: network
Area: Networking
Area: pkg
Area: External package ports
Area: tests
Area: tests and testing framework
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
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 like
at 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:
The text was updated successfully, but these errors were encountered: