Network: Using the broadcast ip may not send through the ethernet interface
Description
Using the 255.255.255.255
address for broadcast may not result in sending the packet through the right interface.
This issue may not be present in all the OS and may be just a network configuration issue from the user but requires attention.
By using the 255.255.255.255
address as outgoing_addr
the message may not be forwarded to the Ethernet interface. Even in case the wi-fi is off.
This issue may be masked in case of loopback.
Steps to Reproduce
- Send a message from SEGS with ethernet connection enabled
- From wireshark verify that it is sent through the ethernet interface
- If not, check if it is sent through the wi-fi interface.
Expected Behavior
It would be expected to have the message sent throughout all the interface.
Actual Behavior
Since broadcast 255.255.255.255
seems to be a single packet, then routed by the OS routing table, the packet might not go through the correct interface.
Environment
- OS: [Ubuntu 22.04]
- Version: [origin/ARP-250529]
- Layout used: [Sending buttons]
Logs / Screenshots / Layout
If applicable, add logs or a screenshot to help explain the problem.
Additional Context
Add any other context, related issues, or suspicions you have.
Possible solution
It might not be the cleanest way but a solution would be changing the IP.
Or rather, dynamically, see the current OS interfaces and send a broadcast for the Ethernet subnet.
As an example, sending dynamically as 192.168.1.255
if a 192.168.1.0/24
network is detected in the routing table/other OS environment informations.
This could crate could be useful to retrieve information on a network interface: https://docs.rs/network-interface/latest/network_interface/struct.V4IfAddr.html#structfield.broadcast